chip8: fix window frame + fix two Page fault issues

git-svn-id: svn://kolibrios.org@8729 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Rustem Gimadutdinov (rgimad) 2021-05-23 10:00:33 +00:00
parent ffc66daaff
commit c09b0569fc
2 changed files with 6 additions and 4 deletions

View File

@ -103,7 +103,7 @@ proc chip8_emulatecycle stdcall
movzx bx, byte [memory + 1 + ecx] movzx bx, byte [memory + 1 + ecx]
or ax, bx or ax, bx
mov word [opcode], ax mov word [opcode], ax
; DEBUGF DBG_INFO, "opcode = 0x%x, ax = 0x%x\n", [opcode]:4, ax DEBUGF DBG_INFO, "opcode = 0x%x, ax = 0x%x\n", [opcode]:4, ax
shr ax, 8 shr ax, 8
and ax, 0x000F and ax, 0x000F
@ -483,8 +483,8 @@ proc chip8_emulatecycle stdcall
.sw5_case_A1: ; skip next instruction if key V[X] is NOT pressed .sw5_case_A1: ; skip next instruction if key V[X] is NOT pressed
movzx ecx, byte [x] movzx ecx, byte [x]
movzx eax, byte [V + ecx] movzx edx, byte [V + ecx]
mov bl, byte [key + eax] mov bl, byte [key + edx]
mov ax, 4 mov ax, 4
cmp bl, 1 cmp bl, 1
jne .sw5_case_A1_endcheck jne .sw5_case_A1_endcheck

View File

@ -1,17 +1,19 @@
; draw main window ; draw main window
align 4 align 4
proc draw_main_window stdcall proc draw_main_window stdcall
DEBUGF DBG_INFO, "draw_main_window() start\n"
mcall 12, 1 ; notify about draw beginning mcall 12, 1 ; notify about draw beginning
mcall 48, 3, sys_colors, sizeof.system_colors mcall 48, 3, sys_colors, sizeof.system_colors
mov edx, [sys_colors.work] ; background color mov edx, [sys_colors.work] ; background color
or edx, 0x74000000 ; window type or edx, 0x74000000 ; window type
; DEBUGF DBG_INFO, "mainwindow w, h = %u, %u", GFX_COLS*GFX_PIX_SIZE + 8, GFX_ROWS*GFX_PIX_SIZE + 28 ; DEBUGF DBG_INFO, "mainwindow w, h = %u, %u", GFX_COLS*GFX_PIX_SIZE + 8, GFX_ROWS*GFX_PIX_SIZE + 28
mcall 0, <50, GFX_COLS*GFX_PIX_SIZE + 8>, <50, GFX_ROWS*GFX_PIX_SIZE + 28>, , , main_window_title ; mcall 0, <50, GFX_COLS*GFX_PIX_SIZE + 9>, <50, GFX_ROWS*GFX_PIX_SIZE + 28>, , , main_window_title ;
stdcall draw_screen stdcall draw_screen
mcall 12, 2 ; notify about draw ending mcall 12, 2 ; notify about draw ending
DEBUGF DBG_INFO, "draw_main_window() end\n"
ret ret
endp endp