?login_element?

Subversion Repositories NedoOS

Rev

Rev 1109 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.         module POP_UP_INFO
  2.  
  3. ;------------------------------------------
  4. reset:
  5.         ld hl,popupAttrAddr
  6.         ld de,popupAttrAddr + 1
  7.         ld bc,7         ; 8 bytes of variables for popup information
  8.         ld (hl),0
  9.         ldir
  10.         ret
  11. ;------------------------------------------
  12. isFinish:
  13.         ; return 0 = finish; !0 = continue
  14.         ld a,(popupAttrAddr)
  15.         or a
  16.        if EGA
  17.        xor a
  18.        endif
  19.         ret
  20. ;------------------------------------------
  21. setExplosion:
  22.         ld hl,#5b04
  23.         ld de,POP_UP_INFO.bitmapExplosion
  24.         ld bc,3 * 256 + %00010010
  25.         jr set
  26. setDone:
  27.         ld hl,#5b04
  28.         ld de,POP_UP_INFO.bitmapDone
  29.         ld bc,3 * 256 + %00110110
  30.         jr set
  31. setPlus10:
  32.         ld hl,#5b08
  33.         ld de,POP_UP_INFO.bitmapPlus10
  34.         ld bc,2 * 256 + %00100100
  35.         jr set
  36. setWasted:
  37.         ld hl,#5b04
  38.         ld de,POP_UP_INFO.bitmapWasted
  39.         ld bc,3 * 256 + %01010010
  40.         jr set
  41. setMore:
  42.         ld hl,#5b04
  43.         ld de,POP_UP_INFO.bitmapMore
  44.         ld bc,3 * 256 + %01100100
  45.         jr set
  46.  
  47. setFear:
  48.         ld hl,#5b04
  49.         ld de,POP_UP_INFO.bitmapFear
  50.         ld bc,3 * 256 + %00010010
  51. set:
  52.         ; until one message is completed, the other cannot be called (the previous message on the attributes is not cleared, it can be corrected)
  53.         call isFinish  
  54.         ret nz
  55.         ; HL - start attributes address (outside the scope of attributes)
  56.         ; DE - bitmap address
  57.         ; B - bitmap width
  58.         ; C - attribute color
  59.         ld (popupAttrAddr),hl
  60.         ld (popupBitmapAddr),de
  61.         ld (popupBitmapColor),bc
  62.         ret
  63. ;------------------------------------------
  64. show:
  65.         ld a,(bitmapWidth)
  66.         or a
  67.         ret z
  68.        if EGA
  69.         ld hl,(popupAttrAddr)
  70.        else
  71.         ld c,a          ; pop-up width
  72.         ld de,(popupBitmapAddr)
  73.         ld ix,buffer256         ; buffer for save backgroud attributes
  74.         ld hl,(popupPreAttrAddr)
  75.         ld a,l
  76.         or h
  77.         jr z,.onlyPaint
  78.         ; restore background
  79.         push de
  80.         push bc
  81.         ld a,c
  82.         rlca
  83.         rlca
  84.         rlca
  85.         sub 32
  86.         neg
  87.         ld e,a
  88.         ld d,0
  89.         ; de = the number to add to the attribute address to get the next line.
  90.         ld b,5
  91.  
  92. .restoreFull:
  93.         push bc
  94.         ld b,c
  95.         ld a,h
  96.         cp #58
  97.         jr nc,.more
  98.         ; skip attributes line
  99.         push bc
  100.         ld bc,32
  101.         add hl,bc
  102.         pop bc
  103.         jr .next + 1
  104. .more:
  105.         cp #5B
  106.         jr nc,.next
  107. .restoreLine:
  108.  
  109.         ld a,1
  110. .restoreByte:
  111.         ex af,af
  112.         ld a,(ix)
  113.         ld (hl),a
  114.         inc ixl
  115.         inc l
  116.         ex af,af
  117.         rlca
  118.         jr nc,.restoreByte
  119.         djnz .restoreLine
  120. .next: 
  121.         add hl,de
  122.         pop bc
  123.         djnz .restoreFull
  124.  
  125.         pop bc
  126.         pop de
  127. .onlyPaint:
  128.         ; paint
  129.         ld ixl,0
  130.         ld hl,(popupAttrAddr)
  131.         ld (popupPreAttrAddr),hl
  132.         ld a,h
  133.         cp #57
  134.         jp c,reset
  135.         push hl
  136.         ; set top color and convert to paper
  137.         ld a,(popupBitmapColor)
  138.         ex af,af
  139.         ld b,5  ; lines count
  140. .full:
  141.         push bc
  142.         push hl
  143.         ld b,c  ; line count bytes
  144. .line:
  145.         ld a,h
  146.         cp #58
  147.         jr c,.skipBitmapLine
  148.         cp #5B
  149.         jr nc,.l1
  150.         push bc
  151.         ld a,(de)
  152.         ld b,8
  153. .byte:
  154.         rlca
  155.         ld c,(hl)
  156.         jr nc,.con
  157.         ex af,af
  158.         ld (hl),a
  159.         ex af,af
  160. .con:
  161.         inc l
  162.         ld (ix),c
  163.         inc ixl
  164.         djnz .byte
  165.         inc de
  166.         pop bc
  167.         djnz .line
  168. .l1:
  169.         pop hl
  170.         ld bc,32
  171.         add hl,bc
  172.         pop bc
  173.         djnz .full
  174.         pop hl
  175.        endif
  176.         ; brightness set/res for current message
  177.         ld a,(popupBitmapColor)
  178.         xor #40
  179.         ld (popupBitmapColor),a
  180.  
  181.         ; get line above
  182.         ld bc,#10000 - 32
  183.         add hl,bc
  184.         ld (popupAttrAddr),hl
  185.         ret
  186.        if !EGA
  187. .skipBitmapLine:
  188.         ld a,(bitmapWidth)
  189.         add e
  190.         ld e,a
  191.         adc a,d
  192.         sub e
  193.         ld d,a
  194.         jr .l1
  195.        endif
  196. ;------------------------------------------
  197. bitmapPlus10:
  198.         db %00000100, %01110000
  199.         db %01001100, %10001000
  200.         db %11100100, %10001000
  201.         db %01000100, %10001000
  202.         db %00001110, %01110000
  203. bitmapFear:
  204.         db %11110111, %10011100, %11110001
  205.         db %10000100, %00100010, %10001001
  206.         db %11100111, %00111110, %11110001
  207.         db %10000100, %00100010, %10001000
  208.         db %10000111, %10100010, %10001001
  209. bitmapDone:
  210.         db %11110001, %11001000, %10111110
  211.         db %10001010, %00101100, %10100000
  212.         db %10001010, %00101010, %10111000
  213.         db %10001010, %00101001, %10100000
  214.         db %11110001, %11001000, %10111110
  215. bitmapExplosion:
  216.         db %11110001, %11000111, %00100010
  217.         db %10001010, %00101000, %10110110
  218.         db %11110010, %00101000, %10101010
  219.         db %10001010, %00101000, %10100010
  220.         db %11110001, %11000111, %00100010
  221. bitmapWasted:
  222.         db %10001001, %00011011, %10110110
  223.         db %10001010, %10100001, %00100101
  224.         db %10101011, %10010001, %00110101
  225.         db %10101010, %10001001, %00100101
  226.         db %01010010, %10110001, %00110110
  227. bitmapMore:
  228.         db %01000100, %11100111, %10011110
  229.         db %01101101, %00010100, %01010000
  230.         db %01010101, %00010111, %10011000
  231.         db %01000101, %00010100, %01010000
  232.         db %01000100, %11100100, %01011110
  233.  
  234. ;------------------------------------------
  235.  
  236.  
  237.         endmodule
  238.