home *** CD-ROM | disk | FTP | other *** search
/ Dream 44 / Amiga_Dream_44.iso / RiscPc / jeux / biohazard.arc / s / SmallMapVG < prev    next >
Text File  |  1995-06-02  |  22KB  |  957 lines

  1. ; Use the GET directive to include register definitions as if typed here
  2.  
  3.       KEEP
  4.           GET     h.WolfReg
  5.  
  6. ; Use the GET directive to include a list of SWI names as if typed here
  7.  
  8.           GET     h.SWInames
  9.  
  10. ; Area name C$$code advisable as wanted to link with C output
  11.  
  12.           AREA    |C$$code|, CODE, READONLY
  13.  
  14. ; Export global symbols
  15.  
  16.       EXPORT  |PlotSmallMapVGA|
  17.       EXPORT  |PlotSmallFadedMapVGA|
  18.  
  19. ;on entry
  20. ;
  21. ; r0 = pointer to data block where :-
  22. ;
  23. ; 0 = pointer to x1
  24. ; 1 = pointer to y1
  25. ; 2 = screen address (of the first line to draw on)
  26. ; 3 = pointer to map data to use as map.
  27. ;        This is simply a 64x64 block of data
  28. ; 4 = x pixel increment
  29. ; 5 = y pixel increment
  30. ; 6 = x line increment
  31. ; 7 = y line increment
  32.  
  33. |PlotSmallMapVGA|
  34.       STMFD   r13!,{r0-r12,link}
  35.  
  36.       ;load up block data
  37.           MOV     r14,r0
  38.           LDMIA   r14,{r0-r5}
  39.  
  40.           ;set outer counter
  41.           MOV     r12,#64<<16
  42.  
  43. Outer_Draw_Line
  44.       ;set inner counter
  45.           ORR     r12,r12,#64
  46.  
  47. Draw_Line
  48.           ;clear registers
  49.           MOV     r8,#0
  50.           MOV     r9,r8
  51.           MOV     r10,r8
  52.           MOV     r11,r8
  53.  
  54.       ;check limits of x and y
  55.           CMP     r0,#64<<16
  56.           BGE     skip_1
  57.           CMP     r0,#0
  58.           BLT     skip_1
  59.  
  60.           CMP     r1,#64<<16
  61.           BGE     skip_1
  62.           CMP     r1,#0
  63.           BLT     skip_1
  64.  
  65.       ;construct address from x & y values
  66.           MOV     r6,r0,ASR #16
  67.           MOV     r7,r1,ASR #16
  68.           ADD     r6,r6,r7,LSL #6
  69.  
  70.           ;load byte from map + (x + 64(y))
  71.           LDRB    r8,[r3,r6]
  72.  
  73. skip_1    ;update x & y
  74.           ADD     r0,r0,r4
  75.           ADD     r1,r1,r5
  76.  
  77.  
  78.       ;load byte 2 word 1
  79.       ;check limits of x and y
  80.           CMP     r0,#64<<16
  81.           BGE     skip_2
  82.           CMP     r0,#0
  83.           BLT     skip_2
  84.  
  85.           CMP     r1,#64<<16
  86.           BGE     skip_2
  87.           CMP     r1,#0
  88.           BLT     skip_2
  89.  
  90.       ;construct address from x & y values
  91.           MOV     r6,r0,ASR #16
  92.           MOV     r7,r1,ASR #16
  93.           ADD     r6,r6,r7,LSL #6
  94.  
  95.           ;load byte from map + (x + 64(y))
  96.           LDRB    r9,[r3,r6]
  97.           ORR     r8,r8,r9,LSL #8
  98.  
  99. skip_2    ;update x & y
  100.           ADD     r0,r0,r4
  101.           ADD     r1,r1,r5
  102.  
  103.  
  104.       ;load byte 3 word 1
  105.       ;check limits of x and y
  106.           CMP     r0,#64<<16
  107.           BGE     skip_3
  108.           CMP     r0,#0
  109.           BLT     skip_3
  110.  
  111.           CMP     r1,#64<<16
  112.           BGE     skip_3
  113.           CMP     r1,#0
  114.           BLT     skip_3
  115.  
  116.       ;construct address from x & y values
  117.           MOV     r6,r0,ASR #16
  118.           MOV     r7,r1,ASR #16
  119.           ADD     r6,r6,r7,LSL #6
  120.  
  121.           ;load byte from map + (x + 64(y))
  122.           LDRB    r9,[r3,r6]
  123.           ORR     r8,r8,r9,LSL #16
  124.  
  125. skip_3    ;update x & y
  126.           ADD     r0,r0,r4
  127.           ADD     r1,r1,r5
  128.  
  129.       ;load byte 4 word 1
  130.       ;check limits of x and y
  131.           CMP     r0,#64<<16
  132.           BGE     skip_4
  133.           CMP     r0,#0
  134.           BLT     skip_4
  135.  
  136.           CMP     r1,#64<<16
  137.           BGE     skip_4
  138.           CMP     r1,#0
  139.           BLT     skip_4
  140.  
  141.       ;construct address from x & y values
  142.           MOV     r6,r0,ASR #16
  143.           MOV     r7,r1,ASR #16
  144.           ADD     r6,r6,r7,LSL #6
  145.  
  146.           ;load byte from map + (x + 64(y))
  147.           LDRB    r9,[r3,r6]
  148.           ORR     r8,r8,r9,LSL #24
  149.  
  150. skip_4    ;update x & y
  151.           ADD     r0,r0,r4
  152.           ADD     r1,r1,r5
  153.  
  154.       ;load byte 1 word 2
  155.       ;check limits of x and y
  156.           CMP     r0,#64<<16
  157.           BGE     skip_5
  158.           CMP     r0,#0
  159.           BLT     skip_5
  160.  
  161.           CMP     r1,#64<<16
  162.           BGE     skip_5
  163.           CMP     r1,#0
  164.           BLT     skip_5
  165.  
  166.       ;construct address from x & y values
  167.           MOV     r6,r0,ASR #16
  168.           MOV     r7,r1,ASR #16
  169.           ADD     r6,r6,r7,LSL #6
  170.  
  171.           ;load byte from map + (x + 64(y))
  172.           LDRB    r9,[r3,r6]
  173.  
  174. skip_5    ;update x & y
  175.           ADD     r0,r0,r4
  176.           ADD     r1,r1,r5
  177.  
  178.       ;load byte 2 word 2
  179.       ;check limits of x and y
  180.           CMP     r0,#64<<16
  181.           BGE     skip_6
  182.           CMP     r0,#0
  183.           BLT     skip_6
  184.  
  185.           CMP     r1,#64<<16
  186.           BGE     skip_6
  187.           CMP     r1,#0
  188.           BLT     skip_6
  189.  
  190.       ;construct address from x & y values
  191.           MOV     r6,r0,ASR #16
  192.           MOV     r7,r1,ASR #16
  193.           ADD     r6,r6,r7,LSL #6
  194.  
  195.           ;load byte from map + (x + 64(y))
  196.           LDRB    r10,[r3,r6]
  197.           ORR     r9,r9,r10,LSL #8
  198.  
  199. skip_6    ;update x & y
  200.           ADD     r0,r0,r4
  201.           ADD     r1,r1,r5
  202.  
  203.       ;load byte 3 word 2
  204.       ;check limits of x and y
  205.           CMP     r0,#64<<16
  206.           BGE     skip_7
  207.           CMP     r0,#0
  208.           BLT     skip_7
  209.  
  210.           CMP     r1,#64<<16
  211.           BGE     skip_7
  212.           CMP     r1,#0
  213.           BLT     skip_7
  214.  
  215.       ;construct address from x & y values
  216.           MOV     r6,r0,ASR #16
  217.           MOV     r7,r1,ASR #16
  218.           ADD     r6,r6,r7,LSL #6
  219.  
  220.           ;load byte from map + (x + 64(y))
  221.           LDRB    r10,[r3,r6]
  222.           ORR     r9,r9,r10,LSL #16
  223.  
  224. skip_7    ;update x & y
  225.           ADD     r0,r0,r4
  226.           ADD     r1,r1,r5
  227.  
  228.       ;load byte 4 word 2
  229.       ;check limits of x and y
  230.           CMP     r0,#64<<16
  231.           BGE     skip_8
  232.           CMP     r0,#0
  233.           BLT     skip_8
  234.  
  235.           CMP     r1,#64<<16
  236.           BGE     skip_8
  237.           CMP     r1,#0
  238.           BLT     skip_8
  239.  
  240.       ;construct address from x & y values
  241.           MOV     r6,r0,ASR #16
  242.           MOV     r7,r1,ASR #16
  243.           ADD     r6,r6,r7,LSL #6
  244.  
  245.           ;load byte from map + (x + 64(y))
  246.           LDRB    r10,[r3,r6]
  247.           ORR     r9,r9,r10,LSL #24
  248.  
  249. skip_8    ;update x & y
  250.           ADD     r0,r0,r4
  251.           ADD     r1,r1,r5
  252.  
  253.       ;load byte 1 word 3
  254.       ;check limits of x and y
  255.           CMP     r0,#64<<16
  256.           BGE     skip_9
  257.           CMP     r0,#0
  258.           BLT     skip_9
  259.  
  260.           CMP     r1,#64<<16
  261.           BGE     skip_9
  262.           CMP     r1,#0
  263.           BLT     skip_9
  264.  
  265.       ;construct address from x & y values
  266.           MOV     r6,r0,ASR #16
  267.           MOV     r7,r1,ASR #16
  268.           ADD     r6,r6,r7,LSL #6
  269.  
  270.           ;load byte from map + (x + 64(y))
  271.           LDRB    r10,[r3,r6]
  272.  
  273. skip_9    ;update x & y
  274.           ADD     r0,r0,r4
  275.           ADD     r1,r1,r5
  276.  
  277.       ;load byte 2 word 3
  278.       ;check limits of x and y
  279.           CMP     r0,#64<<16
  280.           BGE     skip_10
  281.           CMP     r0,#0
  282.           BLT     skip_10
  283.  
  284.           CMP     r1,#64<<16
  285.           BGE     skip_10
  286.           CMP     r1,#0
  287.           BLT     skip_10
  288.  
  289.       ;construct address from x & y values
  290.           MOV     r6,r0,ASR #16
  291.           MOV     r7,r1,ASR #16
  292.           ADD     r6,r6,r7,LSL #6
  293.  
  294.           ;load byte from map + (x + 64(y))
  295.           LDRB    r11,[r3,r6]
  296.           ORR     r10,r10,r11,LSL #8
  297.  
  298. skip_10   ;update x & y
  299.           ADD     r0,r0,r4
  300.           ADD     r1,r1,r5
  301.  
  302.       ;load byte 3 word 3
  303.       ;check limits of x and y
  304.           CMP     r0,#64<<16
  305.           BGE     skip_11
  306.           CMP     r0,#0
  307.           BLT     skip_11
  308.  
  309.           CMP     r1,#64<<16
  310.           BGE     skip_11
  311.           CMP     r1,#0
  312.           BLT     skip_11
  313.  
  314.       ;construct address from x & y values
  315.           MOV     r6,r0,ASR #16
  316.           MOV     r7,r1,ASR #16
  317.           ADD     r6,r6,r7,LSL #6
  318.  
  319.           ;load byte from map + (x + 64(y))
  320.           LDRB    r11,[r3,r6]
  321.           ORR     r10,r10,r11,LSL #16
  322.  
  323. skip_11   ;update x & y
  324.           ADD     r0,r0,r4
  325.           ADD     r1,r1,r5
  326.  
  327.       ;load byte 4 word 3
  328.       ;check limits of x and y
  329.           CMP     r0,#64<<16
  330.           BGE     skip_12
  331.           CMP     r0,#0
  332.           BLT     skip_12
  333.  
  334.           CMP     r1,#64<<16
  335.           BGE     skip_12
  336.           CMP     r1,#0
  337.           BLT     skip_12
  338.  
  339.       ;construct address from x & y values
  340.           MOV     r6,r0,ASR #16
  341.           MOV     r7,r1,ASR #16
  342.           ADD     r6,r6,r7,LSL #6
  343.  
  344.           ;load byte from map + (x + 64(y))
  345.           LDRB    r11,[r3,r6]
  346.           ORR     r10,r10,r11,LSL #24
  347.  
  348. skip_12   ;update x & y
  349.           ADD     r0,r0,r4
  350.           ADD     r1,r1,r5
  351.  
  352.       ;load byte 1 word 4
  353.       ;check limits of x and y
  354.           CMP     r0,#64<<16
  355.           BGE     skip_13
  356.           CMP     r0,#0
  357.           BLT     skip_13
  358.  
  359.           CMP     r1,#64<<16
  360.           BGE     skip_13
  361.           CMP     r1,#0
  362.           BLT     skip_13
  363.  
  364.       ;construct address from x & y values
  365.           MOV     r6,r0,ASR #16
  366.           MOV     r7,r1,ASR #16
  367.           ADD     r6,r6,r7,LSL #6
  368.  
  369.           ;load byte from map + (x + 64(y))
  370.           LDRB    r11,[r3,r6]
  371.  
  372. skip_13   ;update x & y
  373.           ADD     r0,r0,r4
  374.           ADD     r1,r1,r5
  375.  
  376.       ;load byte 2 word 4
  377.       ;check limits of x and y
  378.           CMP     r0,#64<<16
  379.           BGE     skip_14
  380.           CMP     r0,#0
  381.           BLT     skip_14
  382.  
  383.           CMP     r1,#64<<16
  384.           BGE     skip_14
  385.           CMP     r1,#0
  386.           BLT     skip_14
  387.  
  388.       ;construct address from x & y values
  389.           MOV     r6,r0,ASR #16
  390.           MOV     r7,r1,ASR #16
  391.           ADD     r6,r6,r7,LSL #6
  392.  
  393.           ;load byte from map + (x + 64(y))
  394.           LDRB    r7,[r3,r6]
  395.           ORR     r11,r11,r7,LSL #8
  396.  
  397. skip_14   ;update x & y
  398.           ADD     r0,r0,r4
  399.           ADD     r1,r1,r5
  400.  
  401.       ;load byte 3 word 4
  402.       ;check limits of x and y
  403.           CMP     r0,#64<<16
  404.           BGE     skip_15
  405.           CMP     r0,#0
  406.           BLT     skip_15
  407.  
  408.           CMP     r1,#64<<16
  409.           BGE     skip_15
  410.           CMP     r1,#0
  411.           BLT     skip_15
  412.  
  413.       ;construct address from x & y values
  414.           MOV     r6,r0,ASR #16
  415.           MOV     r7,r1,ASR #16
  416.           ADD     r6,r6,r7,LSL #6
  417.  
  418.           ;load byte from map + (x + 64(y))
  419.           LDRB    r7,[r3,r6]
  420.           ORR     r11,r11,r7,LSL #16
  421.  
  422. skip_15   ;update x & y
  423.           ADD     r0,r0,r4
  424.           ADD     r1,r1,r5
  425.  
  426.       ;load byte 4 word 4
  427.       ;check limits of x and y
  428.           CMP     r0,#64<<16
  429.           BGE     skip_16
  430.           CMP     r0,#0
  431.           BLT     skip_16
  432.  
  433.           CMP     r1,#64<<16
  434.           BGE     skip_16
  435.           CMP     r1,#0
  436.           BLT     skip_16
  437.  
  438.       ;construct address from x & y values
  439.           MOV     r6,r0,ASR #16
  440.           MOV     r7,r1,ASR #16
  441.           ADD     r6,r6,r7,LSL #6
  442.  
  443.           ;load byte from map + (x + 64(y))
  444.           LDRB    r7,[r3,r6]
  445.           ORR     r11,r11,r7,LSL #24
  446.  
  447. skip_16   ;update x & y
  448.           ADD     r0,r0,r4
  449.           ADD     r1,r1,r5
  450.  
  451.       ;store on screen
  452.       STMIA   r2,{r8-r11}
  453.       ADD     r2,r2,#320
  454.       STMIA   r2!,{r8-r11}
  455.       SUB     r2,r2,#320
  456.  
  457.       ;update inner counter
  458.           SUB     r12,r12,#16
  459.           MOVS    r6,r12,LSL #16
  460.       BNE     Draw_Line
  461.  
  462.              ;update line start coordinates
  463.  
  464.           ;load original points from last line
  465.       LDMIA   r14,{r0,r1}
  466.           ;load line increments
  467.           LDR     r6,[r14,#24]
  468.           LDR     r7,[r14,#28]
  469.  
  470.       ADD     r0,r0,r6
  471.           ADD     r1,r1,r7
  472.  
  473.       STMIA   r14,{r0,r1}
  474.  
  475.       ;update screen start for next line
  476.       ADD     r2,r2,#256
  477.       ADD     r2,r2,#320
  478.  
  479.           ;update inner counter
  480.           SUB     r12,r12,#1<<16
  481.       MOVS    r6,r12,LSR #16
  482.       BNE     Outer_Draw_Line
  483.  
  484. EndPlotMap
  485.           LDMFD   r13!,{r0-r12,pc}
  486.  
  487. ;on entry
  488. ;
  489. ; r0 = pointer to data block where :-
  490. ;
  491. ; 0 = pointer to x1
  492. ; 1 = pointer to y1
  493. ; 2 = screen address (of the first line to draw on)
  494. ; 3 = pointer to map data to use as map.
  495. ;        This is simply a 64x64 block of data
  496. ; 4 = x pixel increment
  497. ; 5 = y pixel increment
  498. ; 6 = x line increment
  499. ; 7 = y line increment
  500.  
  501. |PlotSmallFadedMapVGA|
  502.       STMFD   r13!,{r0-r12,link}
  503.  
  504.       ;load up block data
  505.           MOV     r14,r0
  506.           LDMIA   r14,{r0-r5}
  507.  
  508.           ;set outer counter
  509.           MOV     r12,#64<<16
  510.  
  511. FOuter_Draw_Line
  512.       ;set inner counter
  513.           ORR     r12,r12,#64
  514.  
  515. FDraw_Line
  516.           ;clear registers
  517.           MOV     r8,#0
  518.           MOV     r9,r8
  519.           MOV     r10,r8
  520.           MOV     r11,r8
  521.  
  522.       ;check limits of x and y
  523.           CMP     r0,#64<<16
  524.           BGE     Fskip_1
  525.           CMP     r0,#0
  526.           BLT     Fskip_1
  527.  
  528.           CMP     r1,#64<<16
  529.           BGE     Fskip_1
  530.           CMP     r1,#0
  531.           BLT     Fskip_1
  532.  
  533.       ;construct address from x & y values
  534.           MOV     r6,r0,ASR #16
  535.           MOV     r7,r1,ASR #16
  536.           ADD     r6,r6,r7,LSL #6
  537.  
  538.           ;load byte from map + (x + 64(y))
  539.           LDRB    r8,[r3,r6]
  540.  
  541. Fskip_1    ;update x & y
  542.           ADD     r0,r0,r4
  543.           ADD     r1,r1,r5
  544.  
  545.  
  546.       ;load byte 2 word 1
  547.       ;check limits of x and y
  548.           CMP     r0,#64<<16
  549.           BGE     Fskip_2
  550.           CMP     r0,#0
  551.           BLT     Fskip_2
  552.  
  553.           CMP     r1,#64<<16
  554.           BGE     Fskip_2
  555.           CMP     r1,#0
  556.           BLT     Fskip_2
  557.  
  558.       ;construct address from x & y values
  559.           MOV     r6,r0,ASR #16
  560.           MOV     r7,r1,ASR #16
  561.           ADD     r6,r6,r7,LSL #6
  562.  
  563.           ;load byte from map + (x + 64(y))
  564.           LDRB    r9,[r3,r6]
  565.           ORR     r8,r8,r9,LSL #8
  566.  
  567. Fskip_2    ;update x & y
  568.           ADD     r0,r0,r4
  569.           ADD     r1,r1,r5
  570.  
  571.  
  572.       ;load byte 3 word 1
  573.       ;check limits of x and y
  574.           CMP     r0,#64<<16
  575.           BGE     Fskip_3
  576.           CMP     r0,#0
  577.           BLT     Fskip_3
  578.  
  579.           CMP     r1,#64<<16
  580.           BGE     Fskip_3
  581.           CMP     r1,#0
  582.           BLT     Fskip_3
  583.  
  584.       ;construct address from x & y values
  585.           MOV     r6,r0,ASR #16
  586.           MOV     r7,r1,ASR #16
  587.           ADD     r6,r6,r7,LSL #6
  588.  
  589.           ;load byte from map + (x + 64(y))
  590.           LDRB    r9,[r3,r6]
  591.           ORR     r8,r8,r9,LSL #16
  592.  
  593. Fskip_3    ;update x & y
  594.           ADD     r0,r0,r4
  595.           ADD     r1,r1,r5
  596.  
  597.       ;load byte 4 word 1
  598.       ;check limits of x and y
  599.           CMP     r0,#64<<16
  600.           BGE     Fskip_4
  601.           CMP     r0,#0
  602.           BLT     Fskip_4
  603.  
  604.           CMP     r1,#64<<16
  605.           BGE     Fskip_4
  606.           CMP     r1,#0
  607.           BLT     Fskip_4
  608.  
  609.       ;construct address from x & y values
  610.           MOV     r6,r0,ASR #16
  611.           MOV     r7,r1,ASR #16
  612.           ADD     r6,r6,r7,LSL #6
  613.  
  614.           ;load byte from map + (x + 64(y))
  615.           LDRB    r9,[r3,r6]
  616.           ORR     r8,r8,r9,LSL #24
  617.  
  618. Fskip_4    ;update x & y
  619.           ADD     r0,r0,r4
  620.           ADD     r1,r1,r5
  621.  
  622.       ;load byte 1 word 2
  623.       ;check limits of x and y
  624.           CMP     r0,#64<<16
  625.           BGE     Fskip_5
  626.           CMP     r0,#0
  627.           BLT     Fskip_5
  628.  
  629.           CMP     r1,#64<<16
  630.           BGE     Fskip_5
  631.           CMP     r1,#0
  632.           BLT     Fskip_5
  633.  
  634.       ;construct address from x & y values
  635.           MOV     r6,r0,ASR #16
  636.           MOV     r7,r1,ASR #16
  637.           ADD     r6,r6,r7,LSL #6
  638.  
  639.           ;load byte from map + (x + 64(y))
  640.           LDRB    r9,[r3,r6]
  641.  
  642. Fskip_5    ;update x & y
  643.           ADD     r0,r0,r4
  644.           ADD     r1,r1,r5
  645.  
  646.       ;load byte 2 word 2
  647.       ;check limits of x and y
  648.           CMP     r0,#64<<16
  649.           BGE     Fskip_6
  650.           CMP     r0,#0
  651.           BLT     Fskip_6
  652.  
  653.           CMP     r1,#64<<16
  654.           BGE     Fskip_6
  655.           CMP     r1,#0
  656.           BLT     Fskip_6
  657.  
  658.       ;construct address from x & y values
  659.           MOV     r6,r0,ASR #16
  660.           MOV     r7,r1,ASR #16
  661.           ADD     r6,r6,r7,LSL #6
  662.  
  663.           ;load byte from map + (x + 64(y))
  664.           LDRB    r10,[r3,r6]
  665.           ORR     r9,r9,r10,LSL #8
  666.  
  667. Fskip_6    ;update x & y
  668.           ADD     r0,r0,r4
  669.           ADD     r1,r1,r5
  670.  
  671.       ;load byte 3 word 2
  672.       ;check limits of x and y
  673.           CMP     r0,#64<<16
  674.           BGE     Fskip_7
  675.           CMP     r0,#0
  676.           BLT     Fskip_7
  677.  
  678.           CMP     r1,#64<<16
  679.           BGE     Fskip_7
  680.           CMP     r1,#0
  681.           BLT     Fskip_7
  682.  
  683.       ;construct address from x & y values
  684.           MOV     r6,r0,ASR #16
  685.           MOV     r7,r1,ASR #16
  686.           ADD     r6,r6,r7,LSL #6
  687.  
  688.           ;load byte from map + (x + 64(y))
  689.           LDRB    r10,[r3,r6]
  690.           ORR     r9,r9,r10,LSL #16
  691.  
  692. Fskip_7    ;update x & y
  693.           ADD     r0,r0,r4
  694.           ADD     r1,r1,r5
  695.  
  696.       ;load byte 4 word 2
  697.       ;check limits of x and y
  698.           CMP     r0,#64<<16
  699.           BGE     Fskip_8
  700.           CMP     r0,#0
  701.           BLT     Fskip_8
  702.  
  703.           CMP     r1,#64<<16
  704.           BGE     Fskip_8
  705.           CMP     r1,#0
  706.           BLT     Fskip_8
  707.  
  708.       ;construct address from x & y values
  709.           MOV     r6,r0,ASR #16
  710.           MOV     r7,r1,ASR #16
  711.           ADD     r6,r6,r7,LSL #6
  712.  
  713.           ;load byte from map + (x + 64(y))
  714.           LDRB    r10,[r3,r6]
  715.           ORR     r9,r9,r10,LSL #24
  716.  
  717. Fskip_8    ;update x & y
  718.           ADD     r0,r0,r4
  719.           ADD     r1,r1,r5
  720.  
  721.       ;load byte 1 word 3
  722.       ;check limits of x and y
  723.           CMP     r0,#64<<16
  724.           BGE     Fskip_9
  725.           CMP     r0,#0
  726.           BLT     Fskip_9
  727.  
  728.           CMP     r1,#64<<16
  729.           BGE     Fskip_9
  730.           CMP     r1,#0
  731.           BLT     Fskip_9
  732.  
  733.       ;construct address from x & y values
  734.           MOV     r6,r0,ASR #16
  735.           MOV     r7,r1,ASR #16
  736.           ADD     r6,r6,r7,LSL #6
  737.  
  738.           ;load byte from map + (x + 64(y))
  739.           LDRB    r10,[r3,r6]
  740.  
  741. Fskip_9    ;update x & y
  742.           ADD     r0,r0,r4
  743.           ADD     r1,r1,r5
  744.  
  745.       ;load byte 2 word 3
  746.       ;check limits of x and y
  747.           CMP     r0,#64<<16
  748.           BGE     Fskip_10
  749.           CMP     r0,#0
  750.           BLT     Fskip_10
  751.  
  752.           CMP     r1,#64<<16
  753.           BGE     Fskip_10
  754.           CMP     r1,#0
  755.           BLT     Fskip_10
  756.  
  757.       ;construct address from x & y values
  758.           MOV     r6,r0,ASR #16
  759.           MOV     r7,r1,ASR #16
  760.           ADD     r6,r6,r7,LSL #6
  761.  
  762.           ;load byte from map + (x + 64(y))
  763.           LDRB    r11,[r3,r6]
  764.           ORR     r10,r10,r11,LSL #8
  765.  
  766. Fskip_10   ;update x & y
  767.           ADD     r0,r0,r4
  768.           ADD     r1,r1,r5
  769.  
  770.       ;load byte 3 word 3
  771.       ;check limits of x and y
  772.           CMP     r0,#64<<16
  773.           BGE     Fskip_11
  774.           CMP     r0,#0
  775.           BLT     Fskip_11
  776.  
  777.           CMP     r1,#64<<16
  778.           BGE     Fskip_11
  779.           CMP     r1,#0
  780.           BLT     Fskip_11
  781.  
  782.       ;construct address from x & y values
  783.           MOV     r6,r0,ASR #16
  784.           MOV     r7,r1,ASR #16
  785.           ADD     r6,r6,r7,LSL #6
  786.  
  787.           ;load byte from map + (x + 64(y))
  788.           LDRB    r11,[r3,r6]
  789.           ORR     r10,r10,r11,LSL #16
  790.  
  791. Fskip_11   ;update x & y
  792.           ADD     r0,r0,r4
  793.           ADD     r1,r1,r5
  794.  
  795.       ;load byte 4 word 3
  796.       ;check limits of x and y
  797.           CMP     r0,#64<<16
  798.           BGE     Fskip_12
  799.           CMP     r0,#0
  800.           BLT     Fskip_12
  801.  
  802.           CMP     r1,#64<<16
  803.           BGE     Fskip_12
  804.           CMP     r1,#0
  805.           BLT     Fskip_12
  806.  
  807.       ;construct address from x & y values
  808.           MOV     r6,r0,ASR #16
  809.           MOV     r7,r1,ASR #16
  810.           ADD     r6,r6,r7,LSL #6
  811.  
  812.           ;load byte from map + (x + 64(y))
  813.           LDRB    r11,[r3,r6]
  814.           ORR     r10,r10,r11,LSL #24
  815.  
  816. Fskip_12   ;update x & y
  817.           ADD     r0,r0,r4
  818.           ADD     r1,r1,r5
  819.  
  820.       ;load byte 1 word 4
  821.       ;check limits of x and y
  822.           CMP     r0,#64<<16
  823.           BGE     Fskip_13
  824.           CMP     r0,#0
  825.           BLT     Fskip_13
  826.  
  827.           CMP     r1,#64<<16
  828.           BGE     Fskip_13
  829.           CMP     r1,#0
  830.           BLT     Fskip_13
  831.  
  832.       ;construct address from x & y values
  833.           MOV     r6,r0,ASR #16
  834.           MOV     r7,r1,ASR #16
  835.           ADD     r6,r6,r7,LSL #6
  836.  
  837.           ;load byte from map + (x + 64(y))
  838.           LDRB    r11,[r3,r6]
  839.  
  840. Fskip_13   ;update x & y
  841.           ADD     r0,r0,r4
  842.           ADD     r1,r1,r5
  843.  
  844.       ;load byte 2 word 4
  845.       ;check limits of x and y
  846.           CMP     r0,#64<<16
  847.           BGE     Fskip_14
  848.           CMP     r0,#0
  849.           BLT     Fskip_14
  850.  
  851.           CMP     r1,#64<<16
  852.           BGE     Fskip_14
  853.           CMP     r1,#0
  854.           BLT     Fskip_14
  855.  
  856.       ;construct address from x & y values
  857.           MOV     r6,r0,ASR #16
  858.           MOV     r7,r1,ASR #16
  859.           ADD     r6,r6,r7,LSL #6
  860.  
  861.           ;load byte from map + (x + 64(y))
  862.           LDRB    r7,[r3,r6]
  863.           ORR     r11,r11,r7,LSL #8
  864.  
  865. Fskip_14   ;update x & y
  866.           ADD     r0,r0,r4
  867.           ADD     r1,r1,r5
  868.  
  869.       ;load byte 3 word 4
  870.       ;check limits of x and y
  871.           CMP     r0,#64<<16
  872.           BGE     Fskip_15
  873.           CMP     r0,#0
  874.           BLT     Fskip_15
  875.  
  876.           CMP     r1,#64<<16
  877.           BGE     Fskip_15
  878.           CMP     r1,#0
  879.           BLT     Fskip_15
  880.  
  881.       ;construct address from x & y values
  882.           MOV     r6,r0,ASR #16
  883.           MOV     r7,r1,ASR #16
  884.           ADD     r6,r6,r7,LSL #6
  885.  
  886.           ;load byte from map + (x + 64(y))
  887.           LDRB    r7,[r3,r6]
  888.           ORR     r11,r11,r7,LSL #16
  889.  
  890. Fskip_15   ;update x & y
  891.           ADD     r0,r0,r4
  892.           ADD     r1,r1,r5
  893.  
  894.       ;load byte 4 word 4
  895.       ;check limits of x and y
  896.           CMP     r0,#64<<16
  897.           BGE     Fskip_16
  898.           CMP     r0,#0
  899.           BLT     Fskip_16
  900.  
  901.           CMP     r1,#64<<16
  902.           BGE     Fskip_16
  903.           CMP     r1,#0
  904.           BLT     Fskip_16
  905.  
  906.       ;construct address from x & y values
  907.           MOV     r6,r0,ASR #16
  908.           MOV     r7,r1,ASR #16
  909.           ADD     r6,r6,r7,LSL #6
  910.  
  911.           ;load byte from map + (x + 64(y))
  912.           LDRB    r7,[r3,r6]
  913.           ORR     r11,r11,r7,LSL #24
  914.  
  915. Fskip_16   ;update x & y
  916.           ADD     r0,r0,r4
  917.           ADD     r1,r1,r5
  918.  
  919.       ;store on screen
  920.       STMIA   r2,{r8-r11}
  921.       ADD     r2,r2,#320
  922.       STMIA   r2!,{r8-r11}
  923.       SUB     r2,r2,#320
  924.  
  925.       ;update inner counter
  926.           SUB     r12,r12,#16
  927.           MOVS    r6,r12,LSL #16
  928.       BNE     FDraw_Line
  929.  
  930.              ;update line start coordinates
  931.  
  932.           ;load original points from last line
  933.       LDMIA   r14,{r0,r1}
  934.           ;load line increments
  935.           LDR     r6,[r14,#24]
  936.           LDR     r7,[r14,#28]
  937.  
  938.       ADD     r0,r0,r6,LSL #1
  939.           ADD     r1,r1,r7,LSL #1
  940.  
  941.       STMIA   r14,{r0,r1}
  942.  
  943.       ;update screen start for next line
  944.       ADD     r2,r2,#256
  945.       ADD     r2,r2,#960
  946.  
  947.           ;update inner counter
  948.           SUB     r12,r12,#2<<16
  949.       MOVS    r6,r12,LSR #16
  950.       BNE     FOuter_Draw_Line
  951.  
  952. EndPlotFadedMap
  953.           LDMFD   r13!,{r0-r12,pc}
  954.  
  955.  
  956.       END
  957.