Author Topic: Uncle Remus Tales  (Read 12036 times)

zedd151

  • Member
  • ****
  • Posts: 850
Re: Uncle Remus Tales
« Reply #75 on: June 06, 2018, 02:20:53 AM »
Quote from: Mikl__
.... But it was just a bot

Hey,  we showed up too...    :icon_mrgreen:
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

Mikl__

  • Member
  • ****
  • Posts: 686
Re: Uncle Remus Tales
« Reply #76 on: June 06, 2018, 08:03:45 AM »
Hi, zedd151!
I'm glad to see you again

zedd151

  • Member
  • ****
  • Posts: 850
Re: Uncle Remus Tales
« Reply #77 on: June 06, 2018, 08:26:19 AM »
Just for the record I downloaded movie 01-04, renamed zips  and extracted movie.gif.  so what's the next step?


 :bgrin:
« Last Edit: July 19, 2018, 04:41:55 PM by zedd151 »
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

zedd151

  • Member
  • ****
  • Posts: 850
Re: Uncle Remus Tales
« Reply #78 on: June 06, 2018, 08:34:14 AM »
No, okay I got it. I read further on and in the source == exe looking for movie.gif.

That's pretty good there, Mikl__.

edit == converted the screen capture to gif for size.
« Last Edit: July 19, 2018, 04:41:04 PM by zedd151 »
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

Mikl__

  • Member
  • ****
  • Posts: 686
Re: Uncle Remus Tales
« Reply #79 on: August 03, 2018, 11:07:02 AM »
Windows Creator
A training program for experimenting with numerous parameters of the functions used - so you do not have to edit and compile the source code of the "training" project each time, and you could select the necessary options right in the dialog box and immediately see the result.
Because the forum does not allow you to attach more than four files, so I had to break the message into three parts

Mikl__

  • Member
  • ****
  • Posts: 686
Re: Uncle Remus Tales
« Reply #80 on: August 03, 2018, 11:09:04 AM »
continuation

Mikl__

  • Member
  • ****
  • Posts: 686
Re: Uncle Remus Tales
« Reply #81 on: August 03, 2018, 11:12:12 AM »
ending
asm-/exe- and resource-files and bat-file for building

jj2007

  • Member
  • *****
  • Posts: 8776
  • Assembler is fun ;-)
    • MasmBasic
Re: Uncle Remus Tales
« Reply #82 on: August 03, 2018, 04:14:21 PM »
Fascinating stuff, Mikl! In particular, I wonder how you build that 48-bit code ;)

Mikl__

  • Member
  • ****
  • Posts: 686
Re: Uncle Remus Tales
« Reply #83 on: August 04, 2018, 01:40:10 AM »
Ciao, Jochen!
Why did you write about 48-bit code?
« Last Edit: August 04, 2018, 12:31:27 PM by Mikl__ »

jj2007

  • Member
  • *****
  • Posts: 8776
  • Assembler is fun ;-)
    • MasmBasic
Re: Uncle Remus Tales
« Reply #84 on: August 04, 2018, 02:10:49 AM »
Have a closer look at the path:

Mikl__

  • Member
  • ****
  • Posts: 686
Re: Uncle Remus Tales
« Reply #85 on: August 04, 2018, 02:16:58 AM »
In the beginning there was a directory "masm64", then I created a new directory "masm63", then, well, you can guess yourself...
« Last Edit: August 04, 2018, 09:17:20 PM by Mikl__ »

zedd151

  • Member
  • ****
  • Posts: 850
Re: Uncle Remus Tales
« Reply #86 on: August 04, 2018, 02:58:08 AM »
then I created a new directory "masm63"


 
Sounded like masm64 was a little under par.
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

Mikl__

  • Member
  • ****
  • Posts: 686
Re: Uncle Remus Tales
« Reply #87 on: August 04, 2018, 11:24:12 AM »
Ciao, Jochen!
Hi, All!
Tiny help for the windows creator
  • If you click on Edit->Save you create file "tut_03b.asm".
  • If you click on File-> create window you run "asm3.bat tut_03b.asm".

You must have a directory of masm48 and subdirectories of bin, lib, include. There are ml64.exe, link.exe etc. in masm48\bin and lib- and inc-files in lib- and include-subdirectories. You can change the folder name "masm48" to the one you use. Look carefully at the contents of the file asm3.bat and configure it for yourself. The names of the folders and the structure of your package with the assembler compiler ONLY inside the file asm3.bat.
  • There is attached lib-folder
  • There is attached include-folder
  • There aren't ml64.exe and link.exe in attached bin-folder for obvious reasons, I do not want to violate Microsoft copyrights

If you see errors in the description in English, please write me about them and I will make corrections.
« Last Edit: August 04, 2018, 01:10:58 PM by Mikl__ »

Mikl__

  • Member
  • ****
  • Posts: 686
Re: Uncle Remus Tales
« Reply #88 on: August 05, 2018, 07:13:20 PM »
Rotating Text Window
I once laid out the program with rotating text, now I had to update it, because with a sharp change in the size of the window, the rotating inscription lost the center of the window and its movements became unpredictable. Now I have corrected this defect
Code: [Select]
; GUI #
include win64a.inc
.code
WinMain proc
local msg:MSG
 
    xor ebx,ebx
    mov esi,IMAGE_BASE
    mov edi,offset ClassName
mov ecx,offset FileName
invoke LoadCursorFromFile
mov r12,rax
        mov ecx,0FF0000h
invoke CreateSolidBrush
    push r12 ;hIconSm
    push rdi ;lpszClassName
    push rbx ;lpszMenuName
    push rax ;hbrBackground
    push 10003h ;hCursor
    push r12 ;hIcon
    push rsi ;hInstance
    push rbx ;cbClsExtra & cbWndExtra
    pushaddr WndProc    ;lpfnWndProc
    push sizeof WNDCLASSEX;cbSize & style
    invoke RegisterClassEx,esp    ;addr WNDCLASSEX
    push rbx
    push rsi ;rsi=400000h
    shr esi,7 ;Special CreateWindow position value CW_USEDEFAULT=8000h
    push rbx
    push rbx
    push rsi
    push rsi
    push rsi
    push rsi
    sub esp,20h
    invoke CreateWindowEx,0,edi,edi,WS_OVERLAPPEDWINDOW or WS_VISIBLE
;create timer #0 in 50mSec
    invoke SetTimer,eax,0,50,0
; +---------------------------+
; | entering the message loop |
; +---------------------------+
lea edi,msg
@@: invoke GetMessage,edi,0,0,0
invoke DispatchMessage,edi
jmp @b
WinMain endp
WndProc proc hwnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
local ps:PAINTSTRUCT
local newFont:qword
local oldFont:qword
local x1:dword
local y1:dword
local hDC:qword
local lpPoint:POINT
 
    mov hwnd,rcx
 
    cmp edx,WM_DESTROY
    je wmDESTROY
    cmp edx,WM_PAINT
    je wmPAINT
        cmp edx,WM_SIZE
    je wmSIZE
    cmp edx,WM_TIMER
    je wmTIMER
    leave
    jmp NtdllDefWindowProc_
wmDESTROY:invoke KillTimer,,0;destroy timer #0
invoke RtlExitUserProcess,0
wmSIZE: mov edx,offset expRect
invoke GetClientRect    ;get the size of the client area.
;Dimensions return to a variable expRect
mov eax,expRect.bottom
shr eax,1   
mov y,eax ;y-coordinate of the middle of the screen
mov eax,expRect.right
shr eax,1   
mov x,eax ;x-coordinate of the middle of the screen
jmp wmBYE
wmTIMER:invoke InvalidateRect,,0,TRUE;redraw the text with the current angle value
finit
jmp wmBYE
wmPAINT:lea edx,ps
invoke BeginPaint
mov hDC,rax
invoke SetTextColor,hDC,32C8C8h;RGB=50,200,200 golden letters
invoke SetBkColor,hDC,0FF0000h;RGB=0,0,255 on a blue background
;create a font with the rotation angle specified in lfEscapement and lfOrientation
pushaddr expFont
push DEFAULT_PITCH or FF_SCRIPT
push rbx        ;DEFAULT_QUALITY=0
push rbx        ;CLIP_DEFAULT_PRECIS=0
push rbx        ;OUT_DEFAULT_PRECIS=0
push OEM_CHARSET
push rbx
push rbx
push rbx
push 400
sub esp,20h
invoke CreateFont,26,12,angle,r8
mov newFont,rax
invoke SelectObject,hDC,rax
mov oldFont,rax
;---------text output
mov qword ptr [rsp+20h],sizeof expTxt;length of string
mov r9d,offset expTxt           ;line address
;---------I calculate the position of the beginning of the text
fld angle2;angle of text rotation in radians
fld st(0)
fsincos ;in st(0) the sine of the angle, in st(1) cosine
mov y1,227    ;half of hypotenuse
fimul y1    ;hypotenuse * sin = x
fistp x1
mov edx,x
add edx,x1
fimul y1    ;hypotenuse * cos = y
fistp y1    ;-y
fadd delta      ;increased the angle by 1.6 degrees
fst angle2
fmul delta2 ;translate radians to degrees
fsub delta3  ;The angle of the text is lagging behind the rotation angle by 180 degrees
fld st(0)
fmul delta4
fsubp st(1),st(0)
fistp angle     ;divide the angle by 360 degrees and remember the remainder
mov r8d,y
sub r8d,y1
invoke TextOut,hDC
invoke DeleteObject,newFont ;delete the new font
invoke SelectObject,hDC,oldFont;return the old font to the system
invoke EndPaint,hwnd,&ps
wmBYE:leave
    retn
WndProc endp
;---------------------------------------
ClassName db "Uncle Remus tales:#5 Painting with Rotation Text",0
expTxt  db "Win64 assembly with MASM is great and easy!",0
expFont db "script",0
angle   dq 0
angle2  dq 3.14159265358979323846264338328
delta   dq 0.02792526803190927323077905229;pi*1,6/180
delta2 dq 572.957795130823208767981548141;1800/pi
delta3 dq 1800.0
delta4 dq 0.00027777777777777777777777778;1/3600
hIcon dq ?
FileName db "br_Rabbit3.cur",0
expRect  RECT <>
x dd ?
y dd ?
end

zedd151

  • Member
  • ****
  • Posts: 850
Re: Uncle Remus Tales
« Reply #89 on: August 05, 2018, 07:30:53 PM »
Could be a problem on my end, (no video driver available for Win 7 for this new hardware) but the text stays centered, but there is a lot of flicker in the text (disappearing and reappearing - correct  location, though)  Windows 7 , AMD A6-9220e, RADEON graphics.

I'm going to fire up windws 10 (has all drivers installed) and take another look at it...   8)
I'm not always the sharpest knife in the drawer, but I have my moments.  :P