Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. ; /+===================================================+/
  2. ; // //
  3. ; // Perform Right refresh pass... //
  4. ; // //
  5. ;/+===================================================+/
  6. _ScreenRefresh
  7. ScreenRefresh
  8. ; a0 is chunky screen with right size.
  9. ; Stack everything for API Compliance.
  10. movem.l d0-d7/a0-a6,-(sp)
  11.  
  12. ;========= This Func Go perform the ===========
  13. ;=== Right copy on the Right Hardware ======
  14. ;= From Chunky Screen To a Hidden HARD Screen =
  15.  
  16. tst.b CGXBool
  17. beq.b .noCGXRefresh
  18.  
  19. move.l a0,a5 ;Chunky temporized.
  20.  
  21. ;=== Only draw if screen is frontmost
  22. move.l Intuibase,a6
  23. move.l ib_FirstScreen(a6),a6 ;frontmost
  24. move.l TheScreen,a0
  25. cmpa.l a6,a0
  26. bne.s .endRefresh
  27.  
  28. ;=== BitMap Locking in order to find
  29. ;=== Hardware chunky address & modulo.
  30. move.l Cgxbase,a6 ; !=0
  31.  
  32. move.l TheScreen,a0
  33. move.l sc_RastPort+rp_BitMap(a0),a0
  34.  
  35. lea LockTAG,a1
  36. call LockBitMapTagList
  37. beq .endRefresh
  38. move.l d0,d7
  39. move.l CgxBaseAddress,a1 ; Chunky hardware
  40.  
  41. move.l a5,a0
  42. move.l _ScreenWidth,d0
  43. move.l _ScreenHeight,d1
  44. move.l CgxBytesPerRow,d2 ; ScreenModulo in bytes.
  45. jsr c2c1x1_cpu ; Chunky to Chunky...
  46.  
  47. ;=== Unlock.
  48. move.l d7,d0
  49. move.l Cgxbase,a6 ; !=0
  50. move.l d0,a0
  51. call UnLockBitMap
  52.  
  53.  
  54. .nocgx
  55. bra.b .noAGARefresh
  56. .noCGXRefresh
  57. ;a0 chunky screen.
  58.  
  59. ; d0.w chunkyx [chunky-pixels]
  60. ; d1.w chunkyy [chunky-pixels]
  61. ; d2.w offsx [screen-pixels]
  62. ; d3.w offsy [screen-pixels]
  63. ; a0 chunkyscreen
  64. ; a1 BitMap
  65.  
  66. move.l _ScreenWidth,d0
  67. move.l _ScreenHeight,d1
  68. clr.w d2
  69. clr.w d3
  70.  
  71. move.l LogicSt,a1 ;ScreenBuffer
  72. move.l sb_BitMap(a1),a1 ;BitMap
  73. jsr _c2p1x1_8_c5_bm
  74.  
  75.  
  76. ;// FALSE: now only for aga.
  77. ;== This Func is a part of the triple-buffer ==
  78. ;=== It validates the freshly drawn-screen ====
  79. ;=== to APPEAR at next frame
  80. ; (same for AGA and CGX.)
  81. bsr.w ScreenSwap
  82.  
  83. .noAGARefresh
  84. .endRefresh
  85. movem.l (sp)+,d0-d7/a0-a6 ;//return to C :-)
  86. rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement