Layers.asm 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. include_macros equ 1
  2. include_deb_mac equ 1
  3. include_error_codes equ 1
  4. include include.asm
  5. start32data
  6. align 4
  7. game_grid dd ? ;set bit 7 for re-create
  8. ;set bit 0 for flip
  9. end32data
  10. start32code
  11. extrn load_file:near
  12. extrn my_free:near
  13. re_create proc
  14. ; Check the game grid for blocks that have changed
  15. mov eax,[layer_0_id]
  16. jife eax,no_recreate
  17. fetch_item
  18. cherror esi,e,0,em_internal_error
  19. mov edi,[backscreen]
  20. mov ebx,[game_grid]
  21. mov dh,GRID_Y
  22. create_loop_y: push edi
  23. mov dl,GRID_X
  24. create_loop_x: btr wpt [ebx],7 ;test and reset re-create flag
  25. jnc not_block
  26. bts wpt [ebx],0 ;set for flip routine
  27. push edi
  28. push esi
  29. mov eax,GRID_H
  30. block_loop: push edi
  31. mov ecx,GRID_W/4
  32. rep movsd
  33. pop edi
  34. add edi,game_screen_width
  35. dec eax
  36. jne block_loop
  37. pop esi
  38. pop edi
  39. not_block: inc ebx
  40. add esi,GRID_W*GRID_H
  41. add edi,GRID_W
  42. dec dl
  43. jne create_loop_x
  44. pop edi
  45. add edi,GRID_H*game_screen_width
  46. dec dh
  47. jne create_loop_y
  48. no_recreate: ret
  49. re_create endp
  50. end32code
  51. end
  52.