Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program scrolly;
- uses
- c64_vic;
- const
- SCREEN0_ADDRESS = 1024;
- SCREEN_WIDTH = 40;
- row = 15;
- scroll_text : String = 'this is a simple scroller demo written in pascal and compiled using pas6502 into 6502 assembly code. as you can see, you don''t need pure assembly to do simple effects like this. ';
- logo : array[0..1000 - 1] of Byte = (
- 32,224,224,224,224,32,224,224,224,224,32,224,224,224,32,224,224,224,224,224,32,224,224,224,224,224,32,224,224,224,224,224,32,96,224,224,224,96,32,32,
- 32,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,32,224,224,224,224,224,224,224,224,224,224,224,32,32,
- 32,224,224,32,224,224,224,224,32,224,224,224,224,32,32,224,224,32,32,32,32,224,224,32,32,32,32,224,224,32,96,224,224,32,224,32,32,224,224,96,
- 32,224,224,224,224,224,224,224,224,224,224,224,224,224,32,224,224,224,224,224,32,224,224,224,224,224,32,224,224,32,96,224,224,96,224,224,224,224,224,96,
- 32,224,224,224,224,224,224,224,224,224,224,96,96,224,224,224,224,224,224,224,224,32,224,224,224,224,224,224,224,32,32,224,224,224,224,224,224,224,224,96,
- 32,224,224,32,32,96,224,224,96,224,224,32,96,224,224,224,224,32,32,224,224,32,32,32,96,224,224,224,224,32,32,224,224,224,224,32,32,32,32,96,
- 32,224,224,32,32,96,224,224,96,224,224,32,32,224,224,224,224,32,32,224,224,32,32,32,96,224,224,224,224,32,32,224,224,224,224,32,32,32,32,32,
- 32,224,224,32,32,96,224,224,32,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,32,32,
- 32,96,224,32,32,96,32,224,32,32,224,32,224,224,224,32,224,224,224,224,224,32,224,224,224,224,224,32,224,224,224,224,224,32,224,224,224,224,224,32,
- 32,32,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
- );
- logo_colours : array[0..1000 - 1] of Byte = (
- 14,10,10,10,10,14,10,10,10,10,14,10,10,10,14,1,1,1,1,1,14,1,1,1,1,1,14,1,1,1,1,1,14,1,1,1,1,1,14,14,
- 14,10,0,0,10,0,10,0,0,10,0,10,0,0,0,1,0,0,0,0,0,1,0,0,0,1,14,1,0,0,1,1,0,1,0,0,0,1,14,14,
- 14,10,0,14,10,0,10,0,14,10,0,10,0,14,14,1,0,14,14,14,14,1,0,14,14,14,14,1,0,14,1,1,0,14,0,14,14,1,0,10,
- 14,10,10,10,10,0,10,10,10,10,0,10,10,10,14,1,1,1,1,1,14,1,1,1,1,1,14,1,0,14,1,1,0,1,1,1,1,1,0,10,
- 14,10,0,0,0,0,10,0,0,10,0,10,0,10,0,1,0,0,0,1,0,14,0,0,0,1,0,1,0,14,14,1,0,1,0,0,0,0,0,10,
- 14,10,0,14,14,0,10,0,0,10,0,14,0,10,0,1,0,14,14,1,0,14,14,14,1,1,0,1,0,14,14,1,0,1,0,14,14,14,14,10,
- 14,10,0,14,14,10,10,0,0,10,0,14,14,10,0,1,0,14,14,1,0,14,14,14,1,1,0,1,0,14,14,1,0,1,0,14,14,14,14,14,
- 14,10,0,14,14,10,10,0,14,10,0,10,10,10,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,14,14,
- 14,10,0,14,14,10,14,0,14,14,0,14,0,0,0,14,0,0,0,0,0,14,0,0,0,0,0,14,0,0,0,0,0,14,0,0,0,0,0,14,
- 14,14,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
- 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14
- );
- var
- i : Byte;
- screen : Byte absolute SCREEN0_ADDRESS;
- color : Byte absolute $d800;
- letter_index : Byte;
- procedure stabilize(x : byte); assembler;
- asm
- !:
- burn:
- dex
- bne burn
- end;
- procedure initScreen;
- begin
- for i := 0 to 250 do begin
- screen[i+000] := logo[i+000];
- screen[i+250] := logo[i+250];
- screen[i+500] := logo[i+500];
- screen[i+750] := logo[i+750];
- color[i+000] := logo_colours[i+000];
- color[i+250] := logo_colours[i+250];
- color[i+500] := logo_colours[i+500];
- color[i+750] := logo_colours[i+750];
- end;
- vic.bg_color0 := medium_grey;
- vic.border := light_grey;
- end;
- procedure hardscroll;
- var
- i : Byte;
- begin
- for i := 0 to SCREEN_WIDTH - 1 do begin
- screen[SCREEN_WIDTH*row+i] := screen[SCREEN_WIDTH*row + 1+i];
- color[SCREEN_WIDTH*row+i] := color[SCREEN_WIDTH*row + 1+i];
- end;
- screen[SCREEN_WIDTH * row + 39] := scroll_text[letter_index];
- color[SCREEN_WIDTH * row + 39] := vic.border;
- letter_index := letter_index + 1;
- if letter_index > length(scroll_text) then letter_index := 1;
- end;
- procedure mainLoop;
- var
- scroll : Byte;
- begin
- scroll := 7;
- while true do begin
- vic_waitForRaster(row * 8 - 1 + 50);
- stabilize(8);
- vic_38_columns();
- vic_set_scroll(scroll and 7,3);
- vic_waitForRaster(row * 8 + 7 + 50);
- stabilize(23);
- vic_40_columns();
- vic_set_scroll(0,3);
- if scroll = 0 then begin
- scroll := 7;
- hardscroll();
- end else begin
- scroll := scroll - 1;
- end;
- end;
- end;
- begin
- letter_index := 1;
- disable_irq;
- initScreen;
- mainLoop;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement