?login_element?

Subversion Repositories NedoOS

Rev

Rev 657 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 657 Rev 1410
Line 36... Line 36...
36
 
36
 
37
palettey=workzoney
37
palettey=workzoney
38
palettex8=rightpanelx8
38
palettex8=rightpanelx8
39
 
39
 
40
navigatorx=rightpanelx8*8
40
navigatorx=rightpanelx8*8
41
navigatory=palettey+(8*4)
41
navigatory=palettey+(8*5)
42
navigatorhgt=31 ;лучше не увеличивать, чтобы не было переполнения при умножении на bitmapwid (max 2048)
42
navigatorhgt=31 ;лучше не увеличивать, чтобы не было переполнения при умножении на bitmapwid (max 2048)
43
navigatorwid=31
43
navigatorwid=31
44
 
44
 
45
coordsx=navigatorx
45
coordsx=navigatorx
46
coordsy=navigatory+navigatorhgt+1
46
coordsy=navigatory+navigatorhgt+1
Line 95... Line 95...
95
        ;endm
95
        ;endm
96
 
96
 
97
        org PROGSTART
97
        org PROGSTART
98
gfxeditor_begin
98
gfxeditor_begin
99
main_go
99
main_go
100
;        jp main_go2
100
        jp main_go2
101
;        ds 256
101
        ds 256
102
;main_go2
102
main_go2
103
        ld sp,0x4000 ;не должен опускаться ниже 0x3b00! иначе возможна порча OS
103
        ld sp,0x4000 ;не должен опускаться ниже 0x3b00! иначе возможна порча OS
104
        OS_HIDEFROMPARENT
104
        OS_HIDEFROMPARENT
105
        ld e,0 ;EGA
105
        ld e,0 ;EGA
106
        OS_SETGFX
106
        OS_SETGFX
107
        ;OS_GETSCREENPAGES
107
        ;OS_GETSCREENPAGES
Line 685... Line 685...
685
        jr z,$+5
685
        jr z,$+5
686
        ld de,curcolor2
686
        ld de,curcolor2
687
        call ahl_coords
687
        call ahl_coords
688
        sub palettey
688
        sub palettey
689
        rra
689
        rra
-
 
690
       cp 0x10
-
 
691
       jr c,$+4
-
 
692
       ld a,0x10 ;transparent color 16
690
        and 0x0c
693
        and 0x1c;0x0c
691
        ld bc,-palettex8*8
694
        ld bc,-palettex8*8
692
        add hl,bc
695
        add hl,bc
693
        srl l
696
        srl l
694
        srl l
697
        srl l
695
        srl l
698
        srl l
Line 796... Line 799...
796
        call window_mainloop
799
        call window_mainloop
797
;restore screen:
800
;restore screen:
798
        call showworkscreen
801
        call showworkscreen
799
        ret
802
        ret
800
       
803
       
801
getcontrastcolors
804
getcontrastcolors ;out: lx=background fill color byte 0bRLrrrlll, hx=brush color byte 0bRLrrrlll
802
        push bc
805
        push bc
803
        push de
806
        push de
804
        push hl
807
        push hl
805
        ld hl,workpal
808
        ld hl,workpal
806
;DDp palette: %grbG11RB(low),%grbG11RB(high), инверсные
809
;DDp palette: %grbG11RB(low),%grbG11RB(high), инверсные
Line 860... Line 863...
860
        pop hl
863
        pop hl
861
        pop de
864
        pop de
862
        pop bc
865
        pop bc
863
        ret
866
        ret
864
 
867
 
865
getgreycolor
868
getgreycolor ;TODO не самый яркий и не самый тёмный, если возможно
866
        ld a,0b00111111
869
        ld a,0b00111111
867
        ret
870
        ret
868
 
871
 
869
getblackongrey
872
getblackongrey
870
        call getcontrastcolors
873
        call getcontrastcolors
Line 1289... Line 1292...
1289
        call setpgshapes
1292
        call setpgshapes
1290
 
1293
 
1291
        ld de,256*colorhgt+2
1294
        ld de,256*colorhgt+2
1292
        push de ;y
1295
        push de ;y
1293
        ld bc,256*colory+colorx8
1296
        ld bc,256*colory+colorx8
1294
        ld a,(curcolor1)
1297
        ld hl,(curcolor1)
-
 
1298
        ld h,tpixelrecode/256
-
 
1299
        ld a,(hl)
1295
        call shapes_colortocolormask
1300
        ;call shapes_colortocolormask
1296
        call shapes_prbox
1301
        call shapes_prbox
1297
        ;ld de,256*colorhgt+2
1302
        ;ld de,256*colorhgt+2
1298
        pop de ;y
1303
        pop de ;y
1299
        ld bc,256*colory+colorx8+2
1304
        ld bc,256*colory+colorx8+2
1300
        ld a,(curcolor2)
1305
        ld hl,(curcolor2)
-
 
1306
        ld h,tpixelrecode/256
-
 
1307
        ld a,(hl)
1301
        call shapes_colortocolormask
1308
        ;call shapes_colortocolormask
1302
        jp shapes_prbox
1309
        jp shapes_prbox
1303
 
1310
 
1304
calccurtool
1311
calccurtool
1305
;a=y
1312
;a=y
1306
;определяет номер тулзы по координатам стрелки
1313
;определяет номер тулзы по координатам стрелки
Line 1399... Line 1406...
1399
prpal1
1406
prpal1
1400
        push af
1407
        push af
1401
        push de
1408
        push de
1402
        ld de,0x0801 ;hgt, wid(chr)
1409
        ld de,0x0801 ;hgt, wid(chr)
1403
        push bc
1410
        push bc
-
 
1411
        ld l,a
-
 
1412
        ld h,tpixelrecode/256
-
 
1413
        ld a,(hl)
1404
        call shapes_colortocolormask
1414
        ;call shapes_colortocolormask
1405
        call shapes_prbox
1415
        call shapes_prbox
1406
        pop bc
1416
        pop bc
1407
        pop de
1417
        pop de
1408
        pop af
1418
        pop af
1409
        inc c
1419
        inc c
Line 1476... Line 1486...
1476
        db " 50",0
1486
        db " 50",0
1477
        db "100",0
1487
        db "100",0
1478
        db "200",0
1488
        db "200",0
1479
        db "400",0
1489
        db "400",0
1480
       
1490
       
-
 
1491
setpal_de
-
 
1492
        OS_SETPAL
-
 
1493
        ret
1481
showbitmap
1494
showbitmap
1482
        ld hl,workpal
1495
        ld de,workpal
1483
        call copytemp_setpal
1496
        call setpal_de
1484
        call setpgs_scr
1497
        call setpgs_scr
1485
        ld hl,(curbitmapwid_edit)
1498
        ld hl,(curbitmapwid_edit)
1486
        ld de,(curbitmaphgt)
1499
        ld de,(curbitmaphgt)
1487
        ld a,d
1500
        ld a,d
1488
        or e
1501
        or e
Line 1603... Line 1616...
1603
 
1616
 
1604
setpgshapes
1617
setpgshapes
1605
        push bc
1618
        push bc
1606
curpgshapes=$+1
1619
curpgshapes=$+1
1607
        ld a,0;pgshapes
1620
        ld a,0;pgshapes
1608
        SETPG16K
1621
        SETPG4000
1609
        pop bc
1622
        pop bc
1610
        ret
1623
        ret
1611
 
1624
 
1612
setpgpal
1625
setpgpal
1613
        push bc
1626
        push bc
Line 1626... Line 1639...
1626
        ret
1639
        ret
1627
 
1640
 
1628
        include "window.asm"
1641
        include "window.asm"
1629
        include "navigator.asm"
1642
        include "navigator.asm"
1630
       
1643
       
1631
        include "pal.asm"
1644
        ;include "pal.asm"
1632
       
1645
       
1633
        include "bitmap.asm"
1646
        include "bitmap.asm"
1634
 
1647
 
1635
        include "prbitmap.asm"
1648
        include "prbitmap.asm"
1636
       
1649
       
Line 1688... Line 1701...
1688
 
1701
 
1689
        ;display "$ before align=",/h,$
1702
        ;display "$ before align=",/h,$
1690
       
1703
       
1691
        .align 256
1704
        .align 256
1692
;;;;;;;;;;;;;;;;;;; таблицы для prbitmap
1705
;;;;;;;;;;;;;;;;;;; таблицы для prbitmap
1693
tpixelrecode
-
 
-
 
1706
tpixelrecode ;для увеличенных масштабов (где оба пикселя в байте одинаковые)
1694
;%00003210 => %33210210
1707
;%00003210 => %33210210
1695
        dup 256
1708
        dup 16
1696
_3=$&8
1709
_3=$&8
1697
_210=$&7
1710
_210=$&7
1698
        db (_3*0x18) + (_210*0x09)
1711
        db (_3*0x18) + (_210*0x09)
1699
        edup
1712
        edup
-
 
1713
        dup 256-16
-
 
1714
        db 0b10111000 ;TODO patched maxbrightL+minbrightR/minbrightL+maxbrightR
-
 
1715
        edup
1700
       
1716
 
-
 
1717
;эти две таблицы - для 100% и уменьшенных масштабов
1701
tpixelrecodeLEFT
1718
tpixelrecodeLEFT
1702
;%00003210 => %.3...210
1719
;%00003210 => %.3...210
1703
        dup 256
1720
        dup 16
1704
_3=$&8
1721
_3=$&8
1705
_210=$&7
1722
_210=$&7
1706
        db (_3*0x08) + (_210*0x01)
1723
        db (_3*0x08) + (_210*0x01)
1707
        edup
1724
        edup
-
 
1725
        dup 256-16
-
 
1726
        db 0 ;TODO patched maxbrightL/minrightL
-
 
1727
        edup
1708
       
1728
 
1709
tpixelrecodeRIGHT
1729
tpixelrecodeRIGHT
1710
;%00003210 => %3.210...
1730
;%00003210 => %3.210...
1711
        dup 256
1731
        dup 16
1712
_3=$&8
1732
_3=$&8
1713
_210=$&7
1733
_210=$&7
1714
        db (_3*0x10) + (_210*0x08)
1734
        db (_3*0x10) + (_210*0x08)
1715
        edup
1735
        edup
-
 
1736
        dup 256-16
-
 
1737
        db 0b10111000 ;TODO patched minbrightR/maxbrightR
-
 
1738
        edup
1716
       
1739
 
-
 
1740
tbitmappages
-
 
1741
        ;display "tbitmappages=",tbitmappages
-
 
1742
        ds bmpmaxpages,0x7f
-
 
1743
       
-
 
1744
activeend
-
 
1745
        display "activeend=",activeend
-
 
1746
        ds 0x4000-$
-
 
1747
SHAPES_begin
-
 
1748
        include "prshapes.asm"
-
 
1749
        include "prarrow.asm"
-
 
1750
        include "prtext.asm"
-
 
1751
        include "pal.asm"
-
 
1752
        .align 256
1717
;;;;;;;;;;;;;;;;;;; таблицы для палитры
1753
;;;;;;;;;;;;;;;;;;; таблицы для палитры
1718
tsin
1754
tsin
1719
        incbin "tsin200"
1755
        incbin "tsin200"
1720
tarcsin
1756
tarcsin
1721
        incbin "tarcsin"
1757
        incbin "tarcsin"
Line 1734... Line 1770...
1734
        edup
1770
        edup
1735
tsqrt
1771
tsqrt
1736
;аргумент 0..255 (соответствует 0..2)
1772
;аргумент 0..255 (соответствует 0..2)
1737
;результат 0..127 (соответствует 0..1) и выше
1773
;результат 0..127 (соответствует 0..1) и выше
1738
        incbin "sqrtmax2"
1774
        incbin "sqrtmax2"
1739
tbitmappages
-
 
1740
        ;display "tbitmappages=",tbitmappages
-
 
1741
        ds bmpmaxpages,0x7f
-
 
1742
       
-
 
1743
activeend
-
 
1744
        display "activeend=",activeend
-
 
1745
        ds 0x4000-$
-
 
1746
SHAPES_begin
-
 
1747
        include "prshapes.asm"
-
 
1748
        include "prarrow.asm"
-
 
1749
        include "prtext.asm"
-
 
1750
        .align 256
1775
        .align 256
1751
font48
1776
font48
1752
        incbin "64qua.fnt"
1777
        incbin "64qua.fnt"
1753
SHAPES_sz=$-SHAPES_begin
1778
SHAPES_sz=$-SHAPES_begin
1754
        display "Shapes size ",/d,SHAPES_sz," bytes"
1779
        display "Shapes size ",/d,SHAPES_sz," bytes"