Subversion Repositories NedoOS

Rev

Rev 2292 | Blame | Compare with Previous | Last modification | View Log | Download

  1. MODULE viewScreen6912
  2. PUBLIC viewScreen6912
  3. #include "sysdefs.asm"
  4. RSEG CODE
  5.  
  6.         macro YIELD
  7.         push bc
  8.         ld c, CMD_YIELD
  9.         push ix
  10.         push iy
  11.         call  BDOS
  12.         pop iy
  13.         pop ix
  14.         pop bc
  15.         endm
  16.  
  17.  
  18. viewScreen6912:
  19. ; unsigned int viewScreen6912(unsigned char pause, unsigned int bufAdr);
  20. ; DE = buffer adress BC = time in ints out A = key
  21.         xor a
  22.         ld (key), a
  23.         push hl
  24.         push bc ; not for exit
  25.         push de ; not for exit
  26.  
  27.         ld c, CMD_GETMAINPAGES  ;d,e,h,l=pages in 0000,4000,8000,c000, c=flags, b=id
  28.         push ix
  29.         push iy
  30.         call BDOS
  31.         pop iy
  32.         pop ix 
  33.  
  34.         ld (pg4),de
  35.         ld (pgC),hl
  36. display:
  37.         ld e, 0x83
  38.         ld c, CMD_SETGFX
  39.         push ix
  40.         push iy
  41.         halt
  42.         call  BDOS
  43.         pop iy
  44.         pop ix
  45.        
  46.         ld a,(user_scr0_high)
  47.        
  48.         push ix
  49.         push iy
  50.         rst 0x28                ;SETPGC000
  51.         pop iy
  52.         pop ix
  53.        
  54.     pop hl                      ; DE - buffer adress
  55.         ld de, 0xC000
  56.         ld bc, 6912
  57.         ldir
  58.    
  59.         xor a
  60.         out (0xfe), a   ;border 0
  61.  
  62.         pop bc                  ; tics
  63.         ld a, b
  64.     or c
  65.     jp nz, slideshow    ;       tics != 0
  66.        
  67. inkey
  68.        
  69.         YIELD
  70.        
  71.         push ix
  72.         push iy
  73.         rst 0x08                ;OS_GETKEY
  74.         pop iy
  75.         pop ix
  76.         halt
  77.         halt
  78.         jp nz, inkey
  79.         ld a,c
  80.         or a
  81.         jp z, inkey
  82.  
  83. exit3
  84.         ld (key), a
  85.         ld e, 0x86
  86.         ld c, CMD_SETGFX
  87.         push ix
  88.         push iy
  89.         ;halt
  90.         call BDOS
  91.         pop iy
  92.         pop ix
  93.         ld a, (pgC)
  94.         push ix
  95.         push iy
  96.         rst 0x28        ;SETPGC000
  97.         pop iy
  98.         pop ix
  99.         pop hl
  100.         ld a, (key)
  101.         ret
  102.  
  103. slideshow ;BC ints
  104.         YIELD
  105.         dec bc
  106.         ld (waiting),bc
  107.  
  108.         push ix
  109.         push iy
  110.         rst 0x08
  111.         pop iy
  112.         pop ix 
  113.         ld a,c
  114.         or a
  115.     jp nz, exit3       
  116.         halt
  117.         ld bc,(waiting)
  118.         ld a, b
  119.     or c
  120.     jp nz, slideshow
  121.         ld a, 32
  122.         jp exit3       
  123. pg4             defb 0
  124. pg0             defb 0
  125. pgC             defb 0
  126. pg8             defb 0
  127. waiting defw 0
  128. key             defb 0
  129. ENDMOD
  130.  
  131. MODULE rst0x08
  132. PUBLIC rst0x08
  133. #include "sysdefs.asm"
  134. RSEG CODE
  135. rst0x08:       
  136.         push ix
  137.         push iy
  138.         rst 0x08
  139.         pop iy
  140.         pop ix
  141.         ld a,c
  142.         ret
  143. ENDMOD 
  144.  
  145. MODULE viewScreen6912NoKeyGraph
  146. PUBLIC viewScreen6912NoKeyGraph
  147. #include "sysdefs.asm"
  148. RSEG CODE
  149.  
  150. viewScreen6912NoKeyGraph:      
  151.         ld a, d
  152.         ld (waiting), a         ; ints
  153.         ld (bufAdr), bc         ; bufadr
  154.         ld a, e
  155.         ld (border), a          ; border
  156.  
  157.         ld e, a
  158.     push bc
  159.         push hl
  160.         push ix
  161.         push iy
  162.     ld c,CMD_SETBORDER ;e=0..15
  163.         call BDOS
  164.         pop iy
  165.         pop ix
  166.         pop hl
  167.         pop bc
  168.  
  169.  
  170.         push hl
  171.  
  172.         ld c, CMD_GETMAINPAGES  ;d,e,h,l=pages in 0000,4000,8000,c000, c=flags, b=id
  173.         push ix
  174.         push iy
  175.         call BDOS
  176.         pop iy
  177.         pop ix 
  178.  
  179.         ld (pg4),de
  180.         ld (pgC),hl
  181. display:
  182.         ld a, (curScr)
  183.         or a
  184.         ld a,(user_scr1_high)
  185.         jp z, fillScr
  186.         ld a,(user_scr0_high)
  187. fillScr
  188.         push ix
  189.         push iy
  190.         rst 0x28                ;SETPGC000
  191.         pop iy
  192.         pop ix
  193.  
  194.     ld hl, (bufAdr)
  195.         ld de, 0xC000
  196.         ld bc, 6912
  197.         ldir
  198.  
  199.         ld a, (curScr)
  200.         xor 1
  201.         ld (curScr), a
  202.  
  203. changeScr
  204.         ld a, (curScr)
  205.         ld e,a
  206.     push bc
  207.         push hl
  208.         push ix
  209.         push iy
  210.         ld c,CMD_SETSCREEN
  211.         call BDOS
  212.         pop iy
  213.         pop ix
  214.         pop hl
  215.         pop bc
  216.  
  217.  
  218. slideshow ;BC ints
  219.         ld a, (waiting)
  220.         ld c, a
  221. slideshow2
  222.         halt
  223.         dec c
  224.     jp nz, slideshow2
  225. exit3
  226.         ld a, (pgC)
  227.         push ix
  228.         push iy
  229.         rst 0x28        ;SETPGC000
  230.         pop iy
  231.         pop ix
  232.         pop hl
  233.         ret
  234.  
  235.  
  236.  
  237.  
  238. pg4             defb 0
  239. pg0             defb 0
  240. pgC             defb 0
  241. pg8             defb 0
  242. waiting defw 0
  243. bufAdr  defw 0
  244. border  defw 0
  245. curScr  defb 0
  246.  
  247. ENDMOD
  248.  
  249. MODULE rst0x08
  250. PUBLIC rst0x08
  251. #include "sysdefs.asm"
  252. RSEG CODE
  253. rst0x08:       
  254.         push ix
  255.         push iy
  256.         rst 0x08
  257.         pop iy
  258.         pop ix
  259.         ld a,c
  260.         ret
  261. ENDMOD
  262.  
  263.  
  264. MODULE CLEARC000
  265. PUBLIC CLEARC000
  266. #include "sysdefs.asm"
  267. RSEG CODE
  268. CLEARC000:     
  269.         push hl
  270.         push bc
  271.         push de
  272.         ld bc, 6912
  273.         ld hl, 0xc000
  274. clearloop:
  275.         ld (hl), 0
  276.         inc hl
  277.         dec bc
  278.         ld a, b
  279.         or c
  280.         jp nz, clearloop
  281.         pop de
  282.         pop bc
  283.         pop hl
  284.         ret
  285. ENDMOD 
  286.  
  287. MODULE OS_HALT
  288. PUBLIC OS_HALT
  289. RSEG CODE
  290. OS_HALT:       
  291.         halt
  292.         ret
  293. ENDMOD 
  294.  
  295.  
  296.  
  297. MODULE CLEARC000FAST
  298. PUBLIC CLEARC000FAST
  299. #include "sysdefs.asm"
  300. RSEG CODE
  301. CLEARC000FAST: 
  302.         push hl
  303.                 push de
  304.                 push bc
  305.                 LD HL,0xc000 + 6912             ; конец картинки
  306.         LD DE,0x0000                    ; заполнение
  307.         LD B,0x36                               ; количество циклов заполнения
  308. ;       CALL fill_hl_de_b
  309. ;       RET
  310. fill_hl_de_b:
  311.         LD (sp_back),SP
  312.         LD SP,HL
  313. l1b:
  314.         PUSH DE
  315.         PUSH DE
  316.         PUSH DE
  317.         PUSH DE
  318.         PUSH DE
  319.         PUSH DE
  320.         PUSH DE
  321.         PUSH DE
  322.         PUSH DE
  323.         PUSH DE
  324.         PUSH DE
  325.         PUSH DE
  326.         PUSH DE
  327.         PUSH DE
  328.         PUSH DE
  329.         PUSH DE
  330.         PUSH DE
  331.         PUSH DE
  332.         PUSH DE
  333.         PUSH DE
  334.         PUSH DE
  335.         PUSH DE
  336.         PUSH DE
  337.         PUSH DE
  338.         PUSH DE
  339.         PUSH DE
  340.         PUSH DE
  341.         PUSH DE
  342.         PUSH DE
  343.         PUSH DE
  344.         PUSH DE
  345.         PUSH DE
  346.         PUSH DE
  347.         PUSH DE
  348.         PUSH DE
  349.         PUSH DE
  350.         PUSH DE
  351.         PUSH DE
  352.         PUSH DE
  353.         PUSH DE
  354.         PUSH DE
  355.         PUSH DE
  356.         PUSH DE
  357.         PUSH DE
  358.         PUSH DE
  359.         PUSH DE
  360.         PUSH DE
  361.         PUSH DE
  362.         PUSH DE
  363.         PUSH DE
  364.         PUSH DE
  365.         PUSH DE
  366.         PUSH DE
  367.         PUSH DE
  368.         PUSH DE
  369.         PUSH DE
  370.         PUSH DE
  371.         PUSH DE
  372.         PUSH DE
  373.         PUSH DE
  374.         PUSH DE
  375.         PUSH DE
  376.         PUSH DE
  377.         PUSH DE
  378.         DJNZ l1b
  379.         defb 0x31               ;ld sp, nn
  380. sp_back:
  381.         defw 0x0000
  382.                 pop bc
  383.                 pop de
  384.                 pop hl
  385.         RET
  386. ENDMOD 
  387.  
  388. END
  389.