Редактирование:
EMIT
(раздел)
Перейти к навигации
Перейти к поиску
Внимание:
Вы не вошли в систему. Ваш IP-адрес будет общедоступен, если вы запишете какие-либо изменения. Если вы
войдёте
или
создадите учётную запись
, её имя будет использоваться вместо IP-адреса, наряду с другими преимуществами.
Анти-спам проверка.
Не
заполняйте это!
=== colorForth (cf2019.nasm 2019 Sep 14) === <PRE> clip1: mov edi, [ v_xy ] mov ecx, edi test cx, cx jns .forward xor ecx, ecx .forward: and ecx, 0x0000FFFF mov [ v_yc ], ecx imul ecx, ( scrnw1 * BYTES_PER_PIXEL ) sar edi, 16 jns .forward2 xor edi, edi .forward2: mov [ v_xc ], edi lea edi, [ edi * BYTES_PER_PIXEL + ecx ] add edi, [ vframe ] ret bit16: ; write a 16 x 24 glyph to the graphic screen lodsw ; load the 16 bit value pointed to by SI into ax xchg al, ah ; eax_TOS_ .back: shl ax, 0x01 ; eax_TOS_ jnc .forward mov [ edi ], dx ; jmp .forward2 .forward: ror edx, 0x10 ; use the background colour, in the high 16 bits ; mov [ edi ], dx ; ror edx, 0x10 ; return to the foreground colour, in the low 16 bits .forward2: add edi, byte BYTES_PER_PIXEL loop .back ret ; write the background after the glyph bit16Background: ; number of pixels to write in ecx , screen address in edi , colours in edx ror edx, 0x10 ; use the background colour, in the high 16 bits .back: ; mov [ edi ], dx ; add edi, byte BYTES_PER_PIXEL loop .back ror edx, 0x10 ; return to the foreground colour, in the low 16 bits ret … emit1: ; ( c -- ) \ display a single width and height character call qcr push esi push edi push edx imul _TOS_, byte 16*24/8 lea esi, [ _TOS_ + font16x24 ] call clip1 mov edx, [ v_foregroundColour ] mov ecx, 0x18 ; 24 lines .back: push ecx mov ecx, 0x10 call bit16 mov ecx, 0x04 push edi call bit16Background pop edi pop ecx add edi, ( scrnw1 - 16 ) * BYTES_PER_PIXEL ; address of the next line of the glyph loop .back ; next horizontal line mov ecx, 0x04 ; 4 background lines .back2: push ecx mov ecx, 0x10 call bit16Background mov ecx, 0x04 push edi call bit16Background pop edi pop ecx add edi, ( scrnw1 - 16 ) * BYTES_PER_PIXEL ; address of the next line of the glyph loop .back2 ; next horizontal line pop edx pop edi pop esi _DROP_ space1: add dword [ v_xy ], iconw1 * 0x10000 ; 22 horizontal pixels ret … clip2: mov edi, [ v_xy ] mov ecx, edi test cx, cx jns .forward xor ecx, ecx .forward: and ecx, 0x0000FFFF mov [ v_yc ], ecx imul ecx, ( scrnw2 * BYTES_PER_PIXEL ) sar edi, 16 jns .forward2 xor edi, edi .forward2: mov [ v_xc ], edi lea edi, [ edi * BYTES_PER_PIXEL + ecx ] add edi, [ vframe ] ret emit2: ; ( c -- ) \ display a single width and height character call qcr push esi push edi push edx imul _TOS_, byte 16*24/8 lea esi, [ _TOS_ + font16x24 ] call clip2 mov edx, [ v_foregroundColour ] mov ecx, 0x18 ; 24 lines .back: push ecx mov ecx, 0x10 call bit16 mov ecx, 0x04 push edi call bit16Background pop edi pop ecx add edi, ( scrnw2 - 16 ) * BYTES_PER_PIXEL ; address of the next line of the glyph loop .back ; next horizontal line mov ecx, 0x04 ; 4 background lines .back2: push ecx mov ecx, 0x10 call bit16Background mov ecx, 0x04 push edi call bit16Background pop edi pop ecx add edi, ( scrnw2 - 16 ) * BYTES_PER_PIXEL ; address of the next line of the glyph loop .back2 ; next horizontal line pop edx pop edi pop esi _DROP_ space2: add dword [ v_xy ], iconw2 * 0x10000 ; 22 horizontal pixels ret … emit_: cmp byte [ displayMode ], 0 jz emit1 jmp emit2 </PRE>
Описание изменений:
Пожалуйста, учтите, что любой ваш вклад в проект «ПМК вики» может быть отредактирован или удалён другими участниками. Если вы не хотите, чтобы кто-либо изменял ваши тексты, не помещайте их сюда.
Вы также подтверждаете, что являетесь автором вносимых дополнений, или скопировали их из источника, допускающего свободное распространение и изменение своего содержимого (см.
Pmkwiki:Авторские права
).
НЕ РАЗМЕЩАЙТЕ БЕЗ РАЗРЕШЕНИЯ ОХРАНЯЕМЫЕ АВТОРСКИМ ПРАВОМ МАТЕРИАЛЫ!
В целях защиты вики от автоматического спама в правках просим вас решить следующую каптчу:
Отменить
Справка по редактированию
(в новом окне)
Навигация
Персональные инструменты
Вы не представились системе
Обсуждение
Вклад
Создать учётную запись
Войти
Пространства имён
Статья
Обсуждение
русский
Просмотры
Читать
Править
История
Ещё
Поиск
Навигация
Заглавная страница
Свежие правки
Случайная страница
Справка по MediaWiki
Инструменты
Ссылки сюда
Связанные правки
Служебные страницы
Сведения о странице