Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;
  2. ; File generated by cc65 v 2.18 - Git c15f497
  3. ;
  4.     .fopt       compiler,"cc65 v 2.18 - Git c15f497"
  5.     .setcpu     "6502"
  6.     .smart      on
  7.     .autoimport on
  8.     .case       on
  9.     .debuginfo  off
  10.     .importzp   sp, sreg, regsave, regbank
  11.     .importzp   tmp1, tmp2, tmp3, tmp4, ptr1, ptr2, ptr3, ptr4
  12.     .macpack    longbranch
  13.     .forceimport    __STARTUP__
  14.     .export     _mem
  15.     .export     _width
  16.     .export     _height
  17.     .export     _line
  18.     .export     _main
  19.  
  20. .segment    "DATA"
  21.  
  22. _width:
  23.     .word   $0028
  24. _height:
  25.     .word   $0019
  26. _mem:
  27.     .word   1024
  28.  
  29. ; ---------------------------------------------------------------
  30. ; void __near__ line (int, int, int, int, unsigned char)
  31. ; ---------------------------------------------------------------
  32.  
  33. .segment    "CODE"
  34.  
  35. .proc   _line: near
  36.  
  37. .segment    "CODE"
  38.  
  39.     jsr     pusha
  40.     ldy     #$04
  41.     jsr     ldaxysp
  42.     sec
  43.     ldy     #$07
  44.     sbc     (sp),y
  45.     pha
  46.     txa
  47.     iny
  48.     sbc     (sp),y
  49.     tax
  50.     pla
  51.     jsr     pushax
  52.     ldy     #$04
  53.     jsr     ldaxysp
  54.     sec
  55.     ldy     #$07
  56.     sbc     (sp),y
  57.     pha
  58.     txa
  59.     iny
  60.     sbc     (sp),y
  61.     tax
  62.     pla
  63.     jsr     pushax
  64.     ldx     #$FF
  65.     txa
  66.     jsr     pushax
  67.     jsr     pushax
  68.     ldy     #$05
  69.     jsr     ldaxysp
  70.     jsr     negax
  71.     jsr     pushax
  72.     jsr     decsp2
  73.     ldy     #$0B
  74.     jsr     ldaxysp
  75.     cpx     #$80
  76.     bcc     L0009
  77.     ldy     #$0D
  78.     jsr     pushwysp
  79.     ldx     #$FF
  80.     txa
  81.     jsr     tosmulax
  82.     ldy     #$0A
  83.     jsr     staxysp
  84. L0009:  ldy     #$09
  85.     jsr     ldaxysp
  86.     cpx     #$80
  87.     bcc     L000D
  88.     ldy     #$0B
  89.     jsr     pushwysp
  90.     ldx     #$FF
  91.     txa
  92.     jsr     tosmulax
  93.     ldy     #$08
  94.     jsr     staxysp
  95. L000D:  ldy     #$14
  96.     jsr     ldaxysp
  97.     ldy     #$0F
  98.     cmp     (sp),y
  99.     txa
  100.     iny
  101.     sbc     (sp),y
  102.     bvc     L003F
  103.     eor     #$80
  104. L003F:  bpl     L0011
  105.     ldx     #$00
  106.     lda     #$01
  107.     ldy     #$06
  108.     jsr     staxysp
  109. L0011:  ldy     #$12
  110.     jsr     ldaxysp
  111.     ldy     #$0D
  112.     cmp     (sp),y
  113.     txa
  114.     iny
  115.     sbc     (sp),y
  116.     bvc     L0040
  117.     eor     #$80
  118. L0040:  bpl     L0015
  119.     ldx     #$00
  120.     lda     #$01
  121.     ldy     #$04
  122.     jsr     staxysp
  123. L0015:  ldy     #$0D
  124.     jsr     pushwysp
  125.     ldy     #$0B
  126.     jsr     ldaxysp
  127.     jsr     tosicmp
  128.     bmi     L0019
  129.     beq     L0019
  130.     ldy     #$0B
  131.     jsr     ldaxysp
  132.     jsr     negax
  133. L0019:  ldy     #$03
  134.     jsr     ldaxysp
  135.     jsr     asrax1
  136.     ldy     #$02
  137.     jsr     staxysp
  138. L0021:  lda     _mem
  139.     ldx     _mem+1
  140.     jsr     pushax
  141.     ldy     #$18
  142.     jsr     pushwysp
  143.     ldy     #$18
  144.     jsr     pushwysp
  145.     lda     _width
  146.     ldx     _width+1
  147.     jsr     tosmulax
  148.     jsr     tosaddax
  149.     jsr     tosaddax
  150.     sta     ptr1
  151.     stx     ptr1+1
  152.     ldy     #$0C
  153.     lda     (sp),y
  154.     ldy     #$00
  155.     sta     (ptr1),y
  156.     ldy     #$14
  157.     jsr     ldaxysp
  158.     ldy     #$0F
  159.     cmp     (sp),y
  160.     bne     L0026
  161.     txa
  162.     iny
  163.     cmp     (sp),y
  164.     bne     L0026
  165.     ldy     #$12
  166.     jsr     ldaxysp
  167.     ldy     #$0D
  168.     cmp     (sp),y
  169.     bne     L0026
  170.     txa
  171.     iny
  172.     cmp     (sp),y
  173.     beq     L001F
  174. L0026:  ldy     #$03
  175.     jsr     ldaxysp
  176.     jsr     stax0sp
  177.     jsr     pushax
  178.     ldy     #$0D
  179.     jsr     ldaxysp
  180.     jsr     negax
  181.     jsr     tosicmp
  182.     bmi     L002C
  183.     beq     L002C
  184.     ldy     #$09
  185.     jsr     ldaxysp
  186.     ldy     #$02
  187.     jsr     subeqysp
  188.     ldy     #$07
  189.     jsr     ldaxysp
  190.     ldy     #$13
  191.     jsr     addeqysp
  192. L002C:  jsr     ldax0sp
  193.     ldy     #$08
  194.     cmp     (sp),y
  195.     txa
  196.     iny
  197.     sbc     (sp),y
  198.     bvc     L0043
  199.     eor     #$80
  200. L0043:  jpl     L0021
  201.     ldy     #$0B
  202.     jsr     ldaxysp
  203.     ldy     #$02
  204.     jsr     addeqysp
  205.     ldy     #$05
  206.     jsr     ldaxysp
  207.     ldy     #$11
  208.     jsr     addeqysp
  209.     jmp     L0021
  210. L001F:  ldy     #$15
  211.     jmp     addysp
  212.  
  213. .endproc
  214.  
  215. ; ---------------------------------------------------------------
  216. ; void __near__ main (void)
  217. ; ---------------------------------------------------------------
  218.  
  219. .segment    "CODE"
  220.  
  221. .proc   _main: near
  222.  
  223. .segment    "CODE"
  224.  
  225.     jsr     push0
  226.     jsr     push0
  227.     lda     #$14
  228.     jsr     pusha0
  229.     jsr     pusha0
  230.     lda     #$05
  231.     jmp     _line
  232.  
  233. .endproc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement