?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. readbmphead_pal
  2.         ld de,bgpush_bmpbuf
  3.         ld hl,14+2;54+(4*16)
  4. ;de=buf
  5. ;hl=size
  6.         call readstream_file
  7.         ld de,bgpush_bmpbuf
  8.         ld hl,(bgpush_bmpbuf+14)
  9.         dec hl
  10.         dec hl
  11. ;de=buf
  12. ;hl=size
  13.         call readstream_file
  14.        ld hl,(bgpush_bmpbuf+2)
  15.        ld a,l
  16.        ld b,4
  17.        srl h
  18.        rra
  19.        djnz $-3
  20.        ld (bmpwid),a
  21.         ld de,bgpush_bmpbuf
  22.         ld hl,+(4*16)
  23. ;de=buf
  24. ;hl=size
  25.         call readstream_file
  26.  
  27.         ld hl,bgpush_bmpbuf;+54
  28.         ld ix,pal
  29.         ld b,16
  30. recodepal0
  31.         ld e,(hl)
  32.         inc hl
  33.         ld d,(hl)
  34.         inc hl
  35.         push hl
  36.         ld l,(hl) ;e=B, d=G, l=R
  37.         call readfile_rgbtopal
  38.         pop hl
  39.         inc hl
  40.         inc hl
  41.         djnz recodepal0
  42.         ret
  43. bmpwid
  44.         dw 0
  45.  
  46. readfile_rgbtopal
  47. ;e=B, d=G, l=R
  48.         call calcRGBtopal_pp
  49.         ld (ix+1),a
  50.         call calcRGBtopal_pp
  51.         ld (ix),a
  52.         inc ix
  53.         inc ix
  54.         ret
  55.  
  56. calcRGBtopal_pp
  57. ;e=B, d=G, l=R
  58. ;DDp palette: %grbG11RB(low),%grbG11RB(high), ??oN????N
  59.         xor a
  60.         rl e  ;B
  61.         rra
  62.         rl l  ;R
  63.         rra
  64.         rrca
  65.         rrca
  66.         rl d  ;G
  67.         rra
  68.         rl e  ;b
  69.         rra
  70.         rl l  ;r
  71.         rra
  72.         rl d  ;g
  73.         rra
  74.         cpl
  75.         ret
  76.  
  77. bgpush_ldbmp_line
  78. ;hl=начало строки ld-push
  79. ;a=pushwid/2
  80.         push bc
  81.         ;push de
  82.  
  83.          push af
  84.         ;push de
  85.         push hl
  86.         push ix
  87.         ld de,bgpush_bmpbuf
  88.         ld h,0
  89.         ld l,a
  90.         add hl,hl
  91.         add hl,hl
  92.         add hl,hl
  93.         add hl,hl
  94.         ;ld hl,320
  95. ;de=buf
  96. ;hl=size
  97.         push hl
  98.         push de
  99.         call readstream_file
  100.         pop de
  101.         pop hl
  102.         add hl,de
  103.         ex de,hl ;de=gfx end addr
  104.         pop ix
  105.         pop hl
  106.         ;pop de
  107.          pop bc
  108.         ;pop af
  109.         ;ld b,a
  110.         dec de ;gfx addr
  111.         ld a,(ix+3)
  112.         call bgpush_ldbmp_layerline
  113.         dec de
  114.         dec de
  115.         ld a,(ix+2);(ix+1)
  116.         call bgpush_ldbmp_layerline
  117.         dec de
  118.         dec de
  119.         ld a,(ix+1);(ix+2)
  120.         call bgpush_ldbmp_layerline        
  121.         dec de
  122.         dec de
  123.         ld a,(ix+0)
  124.         call bgpush_ldbmp_layerline        
  125.         ;pop de
  126.         pop bc
  127.         ret
  128.  
  129. bgpush_ldbmp_layerline
  130. ;пишем каждый четвёртый байт с конца в ld-push
  131. ;de=gfx
  132. ;hl=начало строки ld-push
  133. ;a=pg
  134. ;b=pushwid/2
  135.         ;ld b,pushwid/2
  136.         push bc
  137.         SETPG8000;SETPGPUSHBASE
  138.         pop bc
  139.         push bc
  140.         push de
  141.         push hl
  142.         ;inc hl
  143.         ;inc hl ;мы на втором байте первого слова данных в ld bc
  144. bgpush_ldbmp_bytes0
  145.         inc hl
  146.         inc hl
  147.         RECODEBYTE
  148.         ld (hl),a
  149.         dec hl
  150.          dec de
  151.          dec de
  152.          dec de
  153.          dec de
  154.          dec de
  155.          dec de
  156.         RECODEBYTE
  157.         ld (hl),a
  158.         inc hl
  159.          dec de
  160.          dec de
  161.          dec de
  162.          dec de
  163.          dec de
  164.          dec de
  165.         inc hl
  166.         inc hl
  167.         djnz bgpush_ldbmp_bytes0
  168.         pop hl
  169.         pop de
  170.         pop bc
  171.         ret
  172.