Advertisement
yugorin

dobrego_lamerskie_poczatki

Oct 23rd, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :BasicUpstart2(main)
  2.  
  3. .label PamiecEkranu = $4400
  4. .label Ramka = $d020
  5. .label Ekran = $d021
  6.  
  7. .label memory_setup_register_D018 = $d018
  8. .label VIC_bank = $dd00
  9. //----------------------------------------------------------
  10. // Code for creating the breakpoint file sent to Vice.
  11. //----------------------------------------------------------
  12. .var _useBinFolderForBreakpoints = cmdLineVars.get("usebin") == "true"
  13. .var _createDebugFiles = cmdLineVars.get("afo") == "true"
  14. .print "File creation " + [_createDebugFiles
  15.     ? "enabled (creating breakpoint file)"
  16.     : "disabled (no breakpoint file created)"]
  17. .var brkFile
  18. .if(_createDebugFiles) {
  19.     .if(_useBinFolderForBreakpoints)
  20.         .eval brkFile = createFile("bin/breakpoints.txt")
  21.     else
  22.         .eval brkFile = createFile("breakpoints.txt")
  23. }
  24. .macro break() {
  25. .if(_createDebugFiles) {
  26.     .eval brkFile.writeln("break " + toHexString(*))
  27.     }
  28. }
  29. //------------------------------------------------------
  30.  
  31. .macro trybTekstowy () {
  32. lda #$1b
  33. sta $d011
  34. lda #$c8
  35. sta $d016
  36.        
  37. }
  38.  
  39. .macro trybGraficzny()
  40. {
  41.     lda #$3b
  42.      sta $d011        
  43.  
  44.  
  45.   lda #$08
  46.   sta $d016
  47. }
  48.  
  49. .macro wybierz_index_charmem_pamieci_D018(index) {
  50.   lda memory_setup_register_D018
  51.   and #%11110001 // ustawia tylko bity oznaczone 0
  52.   ora #[index << 1]  // wybiera numer strony pamięci według mapy C64 z netu
  53.   sta memory_setup_register_D018 // zapisuje do $D018
  54. }
  55.  
  56. .macro wybierz_index_screen_memory_pamieci_D018(index) {
  57.   lda memory_setup_register_D018
  58.   and #%00001111 // ustawia tylko bity oznaczone 0
  59.   ora #[index << 4]  // wybiera numer strony pamięci według mapy C64 z netu
  60.   sta memory_setup_register_D018 // zapisuje do $D018
  61. }
  62.  
  63.  
  64. .macro wybierz_index_banku_pamieci_VIC_DD00(index) {
  65.     lda VIC_bank  
  66.     and #%11111100 // zeruje bit #0 i #1
  67.     ora #[index ^ %00000011] // XOR na wartości z index
  68.     sta VIC_bank
  69. }
  70.  
  71. .macro ClearScreen(PamiecEkranu, clearByte) {
  72.   lda #clearByte
  73.   ldx #0
  74. !loop:
  75.   sta PamiecEkranu, x
  76.   sta PamiecEkranu + $100, x
  77.   sta PamiecEkranu + $200, x
  78.   sta PamiecEkranu + $300, x
  79.   inx
  80.   bne !loop-
  81. }
  82.  
  83. .macro ClearScreen_DOL(PamiecEkranu, clearByte) {
  84.   lda #clearByte
  85.   ldx #0
  86. !loop:
  87.   sta PamiecEkranu+633, x
  88.   sta PamiecEkranu+633+100, x
  89.  
  90.   inx
  91.   bne !loop-
  92. }
  93.  
  94. main:
  95.  
  96.  
  97.           sei         //wyłączenie flafi przerwania
  98.  
  99.     :wybierz_index_banku_pamieci_VIC_DD00(1)
  100.  
  101. //          lda #BLACK
  102.   //        sta Ekran
  103.     //      sta Ramka         // wszystko na czarno
  104.  
  105.            
  106.             ldy #$7f    ////; $7f = %01111111
  107.             sty $dc0d   ////; wyłączamy timer CIA
  108.             sty $dd0d   ////; ; wyłączamy timer CIA
  109.             lda $dc0d   ////; kasuje wszystki przerwania CIA w kolejce
  110.             lda $dd0d   ////; kasuje wszystki przerwania CIA w kolejce
  111.          
  112.             lda #$01    ////; Set Interrupt Request Mask...
  113.             sta $d01a   ////; ...we want IRQ by Rasterbeam
  114.  
  115.             lda #<irq1   ////; wskaźnik to IRQ
  116.             ldx #>irq1
  117.             sta $314    ////; zapisz tutaj
  118.             stx $315  
  119.  
  120.             lda #$00    ////; ustawiam pierwsze przerwanie na raster 0
  121.             sta $d012
  122.             lda $d011   ////; ustawiam 9 bit z $d011 na 0            
  123.             and #$7f    ////;
  124.             sta $d011   ////;                                        
  125.  
  126.     :ClearScreen(PamiecEkranu,$20)
  127.             jsr obrazek
  128.             cli      
  129.          
  130.  
  131.             jsr wyswietl_text_1
  132.             jsr wyswietl_text_2
  133. jsr opoznienie3
  134. jsr opoznienie3
  135. jsr opoznienie3
  136. jsr opoznienie3
  137.  
  138. :ClearScreen_DOL($4400,$20)
  139. jsr wyswietl_text_3
  140. jsr opoznienie3
  141. jsr opoznienie3
  142. jsr opoznienie3
  143. jsr opoznienie3
  144. jsr opoznienie3
  145. jsr opoznienie3
  146. jsr opoznienie3
  147. jsr opoznienie3
  148. :ClearScreen_DOL($4400,$20)
  149. jsr wyswietl_text_4
  150. jsr opoznienie3
  151. jsr opoznienie3
  152. jsr opoznienie3
  153. jsr opoznienie3
  154. jsr opoznienie3
  155. jsr opoznienie3
  156. jsr opoznienie3
  157. jsr opoznienie3
  158. :ClearScreen_DOL($4400,$20)
  159. jsr wyswietl_text_5
  160. jsr wyswietl_text_6
  161. jsr opoznienie3
  162. jsr opoznienie3
  163. jsr opoznienie3
  164. jsr opoznienie3
  165. jsr opoznienie3
  166. jsr opoznienie3
  167. jsr opoznienie3
  168. jsr opoznienie3
  169. :ClearScreen_DOL($4400,$20)
  170. jsr wyswietl_text_7
  171.  
  172.  
  173.             jmp *      
  174.  
  175.  
  176.  
  177.        
  178. irq2:    inc $d019
  179.         lda #$60
  180.         sta $d012
  181.         jsr colwash
  182.         :trybTekstowy()
  183.         :wybierz_index_charmem_pamieci_D018(1)
  184. nop
  185. nop
  186. nop
  187. nop
  188. nop
  189. nop
  190. nop
  191. nop
  192.  
  193.         lda #BLACK
  194.         sta Ekran
  195.         lda #WHITE
  196.         sta Ramka
  197.  
  198.  
  199.         lda #<irq3
  200.         sta $0314
  201.         lda #>irq3
  202.         sta $0315
  203.         pla
  204.         tay
  205.         pla
  206.         tax
  207.         pla
  208.         rti
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.        
  216. irq3:    inc $d019
  217.         lda #$b0
  218.         sta $d012
  219. :break()
  220.         :trybGraficzny()
  221.         :wybierz_index_charmem_pamieci_D018(6)
  222.         lda #WHITE
  223. //        sta Ekran
  224.         sta Ramka
  225.  
  226.         lda #<irq1
  227.         sta $0314
  228.         lda #>irq1
  229.         sta $0315
  230.         pla
  231.         tay
  232.         pla
  233.         tax
  234.         pla
  235.         rti
  236.  
  237. irq1:    inc $d019
  238.         lda #$f0
  239.         sta $d012
  240.         :trybTekstowy()
  241.         :wybierz_index_charmem_pamieci_D018(2)
  242.         lda #BLACK
  243.         sta Ekran
  244.         sta Ramka
  245. nop
  246. nop
  247. nop
  248. nop
  249. nop
  250. nop
  251. nop
  252. nop
  253. nop
  254. nop
  255. nop
  256. nop
  257. nop
  258. nop
  259. nop
  260. nop
  261. nop
  262. lda #WHITE
  263. sta Ekran
  264. //sta Ramka
  265.  
  266.         lda #<irq2
  267.         sta $0314
  268.         lda #>irq2
  269.         sta $0315
  270.         pla
  271.         tay
  272.         pla
  273.         tax
  274.         pla
  275.         rti
  276.  
  277. wyswietl_text_1:
  278.  
  279.     ldx #$00
  280.  
  281. !petla:
  282.     lda teksty,x
  283.     sta PamiecEkranu+40,x
  284.     jsr opoznienie
  285.     cpx #72
  286.     beq powrot
  287.     inx
  288.     bne !petla-
  289.  
  290. powrot:  
  291.     rts
  292.  
  293.  
  294.  
  295. wyswietl_text_2:
  296.     ldx #$00
  297. !petla:
  298.     lda tekst_2,x
  299.     sta PamiecEkranu+633,x
  300.     jsr opoznienie
  301.     cpx #195
  302.     beq !powrot+
  303.     inx
  304.     bne !petla-
  305. !powrot:
  306.     rts
  307.  
  308.  
  309.  
  310. wyswietl_text_3:
  311.     ldx #$00
  312. !petla:
  313.     lda tekst_8,x
  314.     sta PamiecEkranu+845,x
  315.     jsr opoznienie
  316.     cpx #31
  317.     beq !powrot+
  318.     inx
  319.     bne !petla-
  320. !powrot:
  321.     rts
  322.  
  323. wyswietl_text_4:
  324.     ldx #$00
  325. !petla:
  326.     lda tekst_10,x
  327.     sta PamiecEkranu+643,x
  328.     jsr opoznienie
  329.     cpx #249
  330.     beq !powrot+
  331.     inx
  332.     bne !petla-
  333. !powrot:
  334.     rts
  335.  
  336.  
  337. wyswietl_text_5:
  338.     ldx #$00
  339. !petla:
  340.     lda tekst_15,x
  341.     sta PamiecEkranu+642,x
  342.     jsr opoznienie
  343.     cpx #255
  344.     beq !powrot+
  345.     inx
  346.     bne !petla-
  347. !powrot:
  348.     rts
  349.  
  350. wyswietl_text_6:
  351.     ldx #$00
  352. !petla:
  353.     lda tekst_16,x
  354.     sta PamiecEkranu+880,x
  355.     jsr opoznienie
  356.     cpx #51
  357.     beq !powrot+
  358.     inx
  359.     bne !petla-
  360. !powrot:
  361.     rts
  362.  
  363.  
  364. wyswietl_text_7:
  365.     ldx #$00
  366. !petla:
  367.     lda tekst_17,x
  368.     sta PamiecEkranu+851,x
  369.     jsr opoznienie
  370.     cpx #22
  371.     beq !powrot+
  372.     inx
  373.     bne !petla-
  374. !powrot:
  375.     rts
  376.  
  377. opoznienie:
  378.       txa
  379.       ldx #$00  
  380. petla1:
  381.       ldy #$00
  382. petla2:
  383.       iny
  384.       cpy #$40
  385.       bne petla2
  386.       inx
  387.       cpx #$90
  388.       bne petla1
  389.       tax
  390.       rts
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.        
  401. colwash:   ldx #$27        
  402.           lda color+$27  
  403.  
  404. cycle1:    ldy color-1,x  
  405.           sta color-1,x  
  406.           sta $d800,x    
  407.           tya            
  408.           dex            
  409.           bne cycle1      
  410.           sta color+$27  
  411.           sta $d800      
  412.                          
  413. colwash2:  ldx #$00      
  414.           lda color2+$27  
  415.  
  416. cycle2:    ldy color2,x  
  417.           sta color2,x    
  418.           sta $d822,x    
  419.           tya            
  420.           inx            
  421.           cpx #$26        
  422.           bne cycle2      
  423.           sta color2+$27  
  424.           sta $d820+$27  
  425.  
  426.           rts            
  427.  
  428.        
  429. colwash2_1:   ldx #$2d    
  430.           lda color+$2a  
  431.  
  432. !cycle1:    ldy color-1,x  
  433.           sta color-1,x  
  434.           sta $d800+593,x  
  435.           tya            
  436.           dex            
  437.           bne !cycle1-    
  438.           sta color+$2d  
  439.           sta $d800+593  
  440.                          
  441.  
  442. colwash2_2:  ldx #$00    
  443.           lda color2+$27  
  444.  
  445. !cycle2:    ldy color2,x  
  446.           sta color2,x    
  447.           sta $d822,x    
  448.           tya            
  449.           inx            
  450.           cpx #$26        
  451.           bne !cycle2-    
  452.           sta color2+$27  
  453.           sta $d820+$27  
  454.  
  455.           rts            
  456.  
  457.  
  458.  
  459. colwash_dol:   ldx #$27    
  460.           lda color+$27  
  461.  
  462. cycle1_dol:    ldy color-1,x
  463.           sta color-1,x  
  464.           sta $d800+920,x
  465.           tya            
  466.           dex            
  467.           bne cycle1_dol  
  468.           sta color+$27  
  469.           sta $d800+920  
  470.                          
  471. colwash2_dol:  ldx #$00  
  472.           lda color2+$27  
  473.  
  474. cycle2_dol:    ldy color2,x  
  475.           sta color2,x    
  476.           sta $dbb2,x    
  477.           tya            
  478.           inx            
  479.           cpx #$26        
  480.           bne cycle2_dol  
  481.           sta color2+$27  
  482.           sta $db20+$27  
  483.  
  484.           rts            
  485.  
  486.  
  487. color:        .byte $09,$09,$02,$02,$08
  488.              .byte $08,$0a,$0a,$0f,$0f
  489.              .byte $07,$07,$01,$01,$01
  490.              .byte $01,$01,$01,$01,$01
  491.              .byte $01,$01,$01,$01,$01
  492.              .byte $01,$01,$01,$07,$07
  493.              .byte $0f,$0f,$0a,$0a,$08
  494.              .byte $08,$02,$02,$09,$09
  495.  
  496. color2:       .byte $09,$09,$02,$02,$08
  497.              .byte $08,$0a,$0a,$0f,$0f
  498.              .byte $07,$07,$01,$01,$01
  499.              .byte $01,$01,$01,$01,$01
  500.              .byte $01,$01,$01,$01,$01
  501.              .byte $01,$01,$01,$07,$07
  502.              .byte $0f,$0f,$0a,$0a,$08
  503.              .byte $08,$02,$02,$09,$09
  504.  
  505.  
  506.  
  507. obrazek:
  508.  
  509.    ldx #$ff
  510.    
  511. laduj_obrazek:
  512. :break()
  513. //    lda $3f40+$4000,x
  514. //    sta PamiecEkranu,x
  515.     lda $3f40+$4000+256,x
  516.     sta PamiecEkranu+256,x
  517.     lda $3f40+$4000+300,x
  518.     sta PamiecEkranu+300,x
  519. //    lda $3f40+$4000+768,x
  520. //    sta PamiecEkranu+768,x
  521.     dex
  522.     bne laduj_obrazek
  523.     rts
  524.  
  525.  
  526. opoznienie2:
  527.         txa
  528.             ldx #$00   
  529.  
  530. petla1_2:
  531.             ldy #$00
  532.  
  533. petla2_2:
  534.             iny
  535.             cpy #$50
  536.             bne petla2_2
  537.             inx
  538.             cpx #$90
  539.             bne petla1_2
  540.             tax
  541.             rts
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549. opoznienie3:
  550.         txa
  551.             ldx #$00   
  552.  
  553. petla4_1:
  554.             ldy #$00
  555.  
  556. petla4_2:
  557.             iny
  558.             cpy #$ff
  559.             bne petla4_2
  560.             inx
  561.             cpx #$ff
  562.             bne petla4_1
  563.             tax
  564.             rts
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572. teksty:
  573.         .text "    yugorin of samar productions"
  574.  
  575. teksty_dolne:
  576.         .text "            prezentuje pierwsze wypociny"
  577.  
  578. tekst_2:
  579.     .text "       nie umiem jeszcze zrobic scrolla"
  580.  
  581. tekst_3:
  582.   .text " ale to kwestia czasu."
  583. tekst_4:
  584.   .text " bardzo chcialem zrobic   pierwsze"
  585. tekst_5:
  586.   .text "'cokolwiek', zeby moc powiedziecwszystkim"
  587. tekst_6:
  588.   .text " ze po 30 latach jestem tu,    gdzie"
  589.  
  590. tekst_7:
  591.   .text " przerwalem jako dziecko."
  592.  
  593.   tekst_8:
  594.   .text " nigdy nie zrobilem scrolla :-) "
  595.  
  596.   tekst_10:
  597.   .text "dziekuje dkt, isildurowi"
  598.   tekst_11:
  599.   .text " i slejerkowi za wiare we mnie."
  600.  
  601.   tekst_12:
  602.   .text "calemu samarowi za    przyjecie,"
  603.  
  604.   tekst_13:
  605.   .text "jammerowi za opierdol na startza dropboxa :-p"
  606.  
  607.     tekst_14:
  608.   .text " wielkie dzieki mojemu   mlodszemu bratu"
  609.     .text " programiscie (fucking   genius) !!!"
  610.   .text " za wsparcie, wiare we mnie, cierpliwosc."
  611.  
  612.   tekst_15:
  613.   .text " to, ze skubany nie zna asm"
  614.   .text " a tlumaczy mi co robie zle"
  615.   .text " sprawia,ze jestem dumny"
  616.   .text " z niego jak nikt na swiecie."
  617.   .text "namawiam go na kodzenie w asm "
  618.   .text "na c64. zobaczymy co z tego wyjdzie."
  619.   .text "na koniec dziekuje asi i biance "
  620.   .text "za to, ze jeszcze nie zwariowaly "
  621.  
  622.   tekst_16:
  623.   .text "bo na kazde pytanie co robie "
  624.   .text "odpowiadam 'kodze' ;-p"
  625.  
  626. tekst_17:
  627.   .text " sceno - przybywam !!!!"
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639. .pc = $6000
  640. .import c64 "smrlogo.art"
  641.  
  642. .pc = $4800
  643. .import c64 "mega_designer_3_c.64c"
  644.  
  645. .pc = $5000
  646. .import c64 "amigo_s.64c"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement