home *** CD-ROM | disk | FTP | other *** search
/ Commodore 64 Scene Diskmags Assortment / Dump_2_1997-06-21_Raiders_of_the_Lost_Empire_Side_A.d64 / init.ass < prev    next >
Text File  |  2023-02-26  |  10KB  |  603 lines

  1.  
  2. ;  sensei/arise/fraction/kreciki
  3. ;  darek domaga\a
  4. ;  kusocinskiego 2/3
  5. ;  64-920
  6. ;  pi\a
  7. ;  tel. (0-67) 13-69-45
  8. ;
  9. ;  - loadery na zamowienie
  10. ;
  11. ;-------------------
  12. ;
  13. ; procedura  wprowadzajaca loader
  14. ; do stacji. wywolywana tylko raz - na
  15. ; poczatku - potem mozna skasowac.
  16. ;
  17. ;-------------------
  18.          jmp fastinit ; 
  19. ;-------------------
  20. fastmw
  21.  
  22.          .byte $78,$20,$91,$01,$49,$18
  23.          .byte $8d,$07,$1c,$49,$13,$85
  24.          .byte $10,$49,$79,$8d,$02,$18
  25.          .byte $20,$e9,$f5,$20,$68,$01
  26.          .byte $ee,$8d,$01,$c6,$10,$d0
  27.          .byte $f6,$4c,$03,$05,$a2,$00
  28.          .byte $8e,$00,$18,$ad,$00,$18
  29.          .byte $d0,$fb,$08,$ad,$00,$18
  30.          .byte $0a,$28,$4d,$00,$18,$0a
  31.          .byte $0a,$0a,$ea,$ea,$ea,$4d
  32.          .byte $00,$18,$0a,$ea,$ea,$ea
  33.          .byte $4d,$00,$18,$9d,$00,$05
  34.          .byte $e8,$d0,$dc,$a9,$08,$8d
  35.          .byte $00,$18,$60,$0f,$07,$0d
  36.          .byte $05,$0b,$03,$09,$01,$0e
  37.          .byte $06,$0c,$04,$0a,$02,$08
  38.          .byte $00
  39.  
  40. ;-------------------
  41. tab      .byte $07,$87,$27,$a7,$47,$c7
  42.          .byte $67,$e7
  43.          .byte $17,$97,$37,$b7,$57,$d7
  44.          .byte $77,$f7
  45. ;-------------------
  46. mw       .byte $ff,32,$01,$46
  47.          .text "w-m"
  48.          .byte $ff
  49.          .byte $01,$46
  50.          .text "e-m"
  51. ;-------------------
  52. open     lda #8
  53.          jsr $ed0c
  54.          lda #$6f
  55.          jmp $edb9
  56. ;-------------------
  57. proc     lda mw,y
  58.          cmp #$ff
  59.          beq *+8
  60.          jsr $eddd
  61.          dey
  62.          bpl proc
  63. errors   rts
  64. ;-------------------
  65. fastinit lda #4
  66.          sta $ab
  67.          lda #>fastmw
  68.          sta $ad
  69.          lda #<fastmw
  70.          sta $ac
  71.  
  72. x5       lda #0
  73.          sta $90
  74.          jsr open
  75.          asl $90
  76.          bcs errors
  77.  
  78.          ldy #6
  79.          jsr proc
  80.          ldx #32
  81. x4       lda ($ac),y
  82.          jsr $eddd
  83.          inc mw+3
  84.          bne *+5
  85.          inc mw+2
  86.          iny
  87.          dex
  88.          bne x4
  89.          jsr $edfe
  90.          clc
  91.          lda $ac
  92.          adc #32
  93.          sta $ac
  94.          bcc *+4
  95.          inc $ad
  96.          dec $ab
  97.          bne x5
  98. ;-------------------
  99.          jsr open
  100.          ldy #12
  101.          jsr proc
  102.          jsr $edfe
  103. ;-------------------
  104.          lda $dd00
  105.          and #3
  106.          sta x2+1
  107.          ora #%00100000
  108.          sta x6+1
  109.          sta $dd00
  110.          tax
  111.          dey
  112.          bne *-1
  113.          dex
  114.          bne *-4
  115.  
  116.          lda #3
  117.          sta $90
  118.  
  119. x3       lda drive,y
  120.          bit $dd00
  121.          bvc *-3
  122.  
  123.          pha
  124.          lsr a
  125.          lsr a
  126.          lsr a
  127.          lrPzz
  128.          tax
  129.  
  130.          sec
  131.          sei
  132. x1       lda $d012
  133.          sbc #50
  134.          bcc x2
  135.          and #7
  136.          beq x1
  137.  
  138. x2       lda #%00000011
  139.          sta $dd00
  140.          lda tab,x
  141.          sta $dd00
  142.          lsr a
  143.          lsr a
  144.          and #%11110111
  145.          sta $dd00
  146.          pla
  147.          and #%00001111
  148.          tax
  149.          lda tab,x
  150.          sta $dd00
  151.          lsr a
  152.          lsr a
  153.          and #%11110111
  154.          sta $dd00
  155.  
  156. x6       lda #%00100011
  157.          iny
  158.          nop
  159.          sta $dd00
  160.          cli
  161.          bne x3
  162.  
  163.          inc x3+2
  164.          dec $90
  165.          bne x3
  166.  
  167.  
  168.          lda #>drive
  169.          sta x3+2
  170.          lda #$01
  171.          sta mw+2
  172.          lda #$46
  173.          sta mw+3
  174.  
  175.          clc
  176.          rts
  177.  
  178. ;-------------------
  179. ;-------------------
  180.  
  181. drive    = *
  182.  
  183.          *= $0500
  184.  
  185.          .offs drive-*
  186.  
  187. ;--------------------
  188. ;--------------------
  189. irqok    = $fd9e
  190. silon    = $f982
  191. siloff   = $f9e8
  192. tabtrans = $0197
  193. osiem    = $0191
  194. ;--------------------
  195.          jmp irq
  196.          jmp start
  197. ;--------------------
  198. odb
  199.          ldy #8
  200.  
  201. a1       lda $1800
  202.          cmp $1800
  203.          beq *-3
  204.          lda $1800
  205.          bmi quit
  206.          lsr a
  207.          ror $0a,x
  208.  
  209.          dey
  210.          bne a1
  211.  
  212.          inx
  213.          rts
  214. ;--------------------
  215. quit     pla
  216.          pla
  217.          jsr $e9a5
  218.          cli
  219.          rts
  220. ;--------------------
  221. irq
  222.          lda $11
  223.          bne pomin
  224.  
  225.          jsr read
  226.  
  227.          lda $0402
  228.          jsr trans
  229.          lda $0403
  230.          jsr trans
  231.          bne pomin
  232. ;--------------------
  233. next
  234.          lda #2
  235.          sta count+1
  236.  
  237.          lda $0a
  238.          eor $11
  239.          beq pomin
  240.          jmp irqok
  241.  
  242. pomin    jsr read
  243.  
  244.          ldx $0401
  245.          ldy $0400
  246.          stx $19
  247.          sty $18
  248.          sty $0a
  249. ;--------------------
  250.          php
  251.          bne nie
  252.          dex
  253.          stx $10
  254.          lda #$c6
  255.          sta wrr
  256. nie      jsr bajty
  257.          plp
  258.          bne next
  259.  
  260.          lda #2
  261.          sta $1800
  262.          tax
  263.          asl a
  264.          bit $1800
  265.          beq *-3
  266.          inx
  267.          bpl *-1
  268.          jmp irqok
  269. ;--------------------
  270. read
  271.          lda #$ee
  272.          jsr $fe05
  273. ;--------------------
  274.          lda $16
  275.          eor $17
  276.          eor $18
  277.          eor $19
  278.          sta $1a
  279.          jsr $f934
  280.  
  281. a51      ldx #0
  282.          lda #8
  283.          eor $1c00
  284.          sta $1c00
  285.          bmi a51+2
  286.          and #%11110111
  287.          sta $1c00
  288.          jsr $f567
  289.  
  290. a21      bvc *
  291.          clv
  292.          lda $1c01
  293.          eor $24,x
  294.          bne a51
  295.          inx
  296.          cpx #8
  297.          bne a21
  298.  
  299.          bit $1c00
  300.          bmi *-3
  301.          jsr $f567
  302. ;--------------------
  303. konwert
  304.          bvc *
  305.          clv
  306.          lda $1c01
  307.          tax
  308.          lsr a
  309.          lsr a
  310.          lsr a
  311.          sta $02ff,y
  312.  
  313.          bvc *
  314.          clv
  315.          lda $1c01
  316.          lsr a
  317.          sta $0300,y
  318.          txa
  319.          and #%00000111
  320.          sta $03ff,y
  321.  
  322.          bvc *
  323.          clv
  324.          lda $1c01
  325.          tax
  326.          ror a
  327.          lsr a
  328.          lsr a
  329.          lsr a
  330.          sta $0400,y
  331.  
  332.          bvc *
  333.          clv
  334.          lda $1c01
  335.          sta $0401,y
  336.          asl a
  337.          txa
  338.          rol a
  339.          sta $0301,y
  340.  
  341.          bvc *
  342.          clv
  343.          lda $1c01
  344.          sta $0402,y
  345.  
  346.          iny
  347.          iny
  348.          iny
  349.          iny
  350.          bne konwert
  351.  
  352.          bvc *
  353.          clv
  354.          lda $1c01
  355.          sta $55
  356.          lsr a
  357.          lsr a
  358.          lsr a
  359.          sta $54
  360.  
  361.          bvc *
  362.          clv
  363.          lda $1c01
  364.          sta $4e
  365.          asl a
  366.          rol $55
  367.          asl a
  368.          rol $55
  369.  
  370. ;------------------
  371. kon      lda $0300,y
  372.          asl a
  373.          asl a
  374.          sta $52
  375.          lda $03ff,y
  376.          rol a
  377.          asl $52
  378.          rol a
  379.          tax
  380.          lda $f8c0,x
  381.          ldx $02ff,y
  382.          ora $f8a0,x
  383.          sta $03ff,y
  384.  
  385.          lda $0300,y
  386.          and #%00011111
  387.          tax
  388.          lda $f8a0,x
  389.          ldx $0400,y
  390.          ora $f8c0,x
  391.          sta $0400,y
  392.  
  393.          lda $0401,y
  394.          sta $56
  395.          lsr a
  396.          lsr a
  397.          and #%00011111
  398.          sta $52
  399.          lda $0301,y
  400.          and #%00011111
  401.          tax
  402.          lda $f8a0,x
  403.          ldx $52
  404.          ora $f8c0,x
  405.          sta $0401,y
  406.  
  407.          lda $0402,y
  408.          sta $52
  409.          and #%00011111
  410.          sta $53
  411.  
  412.          lda $56
  413.          asl $52
  414.          rol a
  415.          asl $52
  416.          rol a
  417.          asl $52
  418.          rol a
  419.          and #%00011111
  420.          tax
  421.          lda $f8a0,x
  422.          ldx $53
  423.          ora $f8c0,x
  424.          sta $0402,y
  425.  
  426.          iny
  427.          iny
  428.          iny
  429.          iny
  430.          bne kon
  431.  
  432.          lda $55
  433.          and #%00011111
  434.          tax
  435.          lda $f8c0,x
  436.          ldx $54
  437.          ora $f8a0,x
  438.          sta $04ff
  439.  
  440.          lda $0a
  441.          sta $11
  442.          rts
  443. ;--------------------
  444. start
  445.          tsx
  446.          stx stos+1
  447.  
  448. power    sei
  449. stos     ldx #$66
  450.          txs
  451.  
  452.          jsr siloff
  453.          jsr osiem
  454.          jsr flash
  455.  
  456.          ldx #0
  457.          stx $11
  458.          stx $1800
  459.          jsr odb
  460.          jsr odb
  461.          jsr osiem
  462.          jsr silon
  463. agien    jsr init
  464.          cmp #2
  465.          bcs agien
  466.  
  467.          lda $12
  468.          sta $16
  469.          lda $13
  470.          sta $17
  471.          lda $0a
  472.          sta $18
  473.          lda $0b
  474.          sta $19
  475. ;--------------------
  476. fast     lda #$e0
  477.          jsr glowica
  478.  
  479.          lda $0a
  480.          bne fast
  481.  
  482.          jmp power
  483. ;--------------------
  484. init     lda #4
  485.          sta count+1
  486.          lda #$85
  487.          sta wrr
  488.          lda #$60
  489.          sta ha
  490.  
  491.          lda #1
  492.          sta $09
  493.          lda #$12
  494.          sta $08
  495.          lda #$b0
  496. ;--------------------
  497.          ldx #1
  498.          .byte $2c
  499. glowica  ldx #2
  500.          sta $0298
  501.          jsr $d580
  502.          cli
  503.          jsr $d5c6
  504.          sei
  505.          rts
  506. ;--------------------
  507. bajty    lda #$ea
  508.          sta ha
  509. count    lda $0404
  510.  
  511. trans    tay
  512.          and #%00001111
  513.          tax
  514.          tya
  515.          lsr a
  516.          lsr a
  517.          lsr a
  518.          lsr a
  519.          tay
  520.          lda #0
  521.          sta $1800
  522.          lda tabtrans,x
  523.          ldx $1800
  524.          bne *-3
  525.          sta $1800
  526.          asl a
  527.          and #%00001010
  528.          sta $1800
  529.          lda tabtrans,y
  530.          sta $1800
  531.          asl a
  532.          and #%00001010
  533.          sta $1800
  534.  
  535.          jsr osiem
  536. ha       rts
  537.  
  538.          inc count+1
  539. wrr      sta $10
  540.          bne count
  541.          rts
  542. ;--------------------
  543. flash
  544.          sta $07
  545.          sta $06
  546.          lda #$e6
  547.          sta p4
  548.  
  549. p1       ldx $06
  550.  
  551.          lda $1c00
  552.          ora #8
  553.          sta $1c00
  554. p2       ldy #1
  555.          tya
  556.          dey
  557.          bne *-1
  558.     ;------------
  559.          bit $1800
  560.          bmi *+4
  561.          bne tu1
  562.          rts
  563.     ;------------
  564. tu1      inx
  565.          bne p2
  566.  
  567.          lda $1c00
  568.          and #$f7
  569.          sta $1c00
  570.          ldx $06
  571. p3       ldy #5
  572.          dey
  573.          bne *-1
  574.     ;------------
  575.          lda #1
  576.          bit $1800
  577.          bmi *+4
  578.          bne tu2
  579.          rts
  580.     ;------------
  581. tu2      dex
  582.          bne p3
  583.  
  584.  
  585. p4       inc $06
  586.          bne p1
  587.  
  588.          lda p4
  589.          eor #$20
  590.          sta p4
  591.  
  592.          lda $07
  593.          eor #$ff
  594.          sta $07
  595.          sta $06
  596.          bne p1
  597. ;--------------------
  598.          .byte $a0,$8c,$8f,$81,$84,$85
  599.          .byte $92,$a0,$82,$99,$a0,$93
  600.          .byte $85,$8e,$93,$85,$89,$a0
  601. ;--------------------
  602.  
  603.