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