Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
program hscroll;
uses atari, b_dl;
const
dlist = $5000;
vmem = $5100;
var hscroll:byte = 3;
offset:byte = 0;
blankSize:byte = 0;
s:string = 'hello! it is an jumping pascal scroll!!'~;
blanks:array[0..15] of byte = (
DL_BLANK8, DL_BLANK7, DL_BLANK6, DL_BLANK5, DL_BLANK4, DL_BLANK3, DL_BLANK2, DL_BLANK1,
DL_BLANK1, DL_BLANK2, DL_BLANK3, DL_BLANK4, DL_BLANK5, DL_BLANK6, DL_BLANK7, DL_BLANK8
);
begin
DL_Init(dlist);
DL_Push(DL_BLANK8, 12); // 12 blank lines
DL_Push(DL_MODE_40x24T2 + DL_HSCROLL + DL_LMS, vmem); // textline
DL_Push(DL_JVB, dlist); // jump back
DL_Start;
move(s[1],pointer(vmem+42),sizeOf(s)); // copy text to vram
color2:=0;
repeat
pause;
if hscroll = $ff then begin // $ff is one below zero
hscroll := 3;
offset := (offset + 1) mod 80; // go trough 0-79
DL_PokeW(13, vmem + offset); // set new memory offset
end;
hscrol := hscroll; // set hscroll
dec(hscroll);
blankSize := (blankSize + 1) and 15; // go trough 0-15
DL_Poke(10, blanks[blankSize]); // set new blankline height
until false;
end.
program hscroll2;
uses atari;
var s:string = 'hello my friends! i''m one char scroll in text mode done in different way, not using display lists '~;
textStart, screenStart:byte;
begin
repeat
textStart:=1;
screenStart:=39;
repeat
move(s[textStart],pointer(savmsc+160+screenStart),40-screenStart);
if screenStart>0 then Dec(screenStart)
else Inc(textStart);
Pause(5);
until textStart>Length(s);
until false;
end.
procedure swap;
begin
if p_data[0]=@p0Data then begin
p_data[0]:=@p0Data1;
p_data[1]:=@p1Data1;
end
else begin
p_data[0]:=@p0Data;
p_data[1]:=@p1Data;
end;
end;
procedure mainLoop;
begin
scrollDir:=dirValues[stick0];
if scrollDir=1 then begin
scrollDir:=0;
coarseScrollLeft;
MoveP(0, 80+scrollCounter, 65);
MoveP(1, 88+scrollCounter, 65);
swap;
end
else if scrollDir=2 then begin
end;
end;
function Swap(a: word): word; overload;
function Swap(a: cardinal): cardinal; overload;
if yes then a65(__subBX);
if Ident[IdentIndex].Kind = FUNC then a65(__subBX);
yes := (Ident[IdentIndex].Kind = FUNC);
m0Data : array [0.._M0_MAX] of byte = (0,0,3,0,0,0,0,0,0,0);
m0Data : array [0.._M0_MAX] of byte = (0,3,0);
_M0_MAX = 2; // Number of missile 0 data values
_M1_MAX = 0; // Number of missile 1 data values
_M2_MAX = 3; // Number of missile 2 data values
_M3_MAX = 4; // Number of missile 3 data values
procedure MoveM (m : byte; x : word; y : byte);
case m of
0: begin
Poke(pm_mem+pm_offset-pm_size+y+_M0_MAX+1, 0);
move(m_data[m], pointer(pm_mem+pm_offset-pm_size+y), _M0_MAX+1);
end;
//cut - other cases
end;
// Missile horizontal position
Poke(53252+m, x);
end;
procedure Dli; interrupt;
begin
asm { phr };
// wsync:=1;
col1:=clr1[dliNum];
col2:=clr2[dliNum];
inc(dliNum);
if dliNum=3 then dliNum:=0;
asm { plr };
end;
sta wsync ; linia 0
sta wsync ; linia 1
lda #44
ldx #68
ldy #54
sta wsync
sta colbak ; linia 2
stx color0
sty color1
lda #20
sta color2
sta wsync ; linia 3
sta wsync ; linia 4
procedure Dli; interrupt;
begin
asm { phr
sta ATARI.WSYNC};
colpm0:=$16;
colpm1:=$26;
colpm2:=$36;
colpm3:=$46;
asm { mwa #DLI2 ATARI.VDSLST
plr };
end;
sta _a
stx _x
sty _y
..
..
lda #0
_a equ *-1
ldx #0
_x equ *-1
ldy #0
_y equ *-1
program hello;
uses atari, crt, graph;
begin
InitGraph(8);
sdmctl:=1; //Poke(559,1)
readkey;
end.
Option Decimal Bit
No playfield 0 0
Narrow playfield 1 0
Standard playfield 2 0,1
Wide playfield 3 0,1
Enable missle DMA 4 2
Enable player DMA 8 3
Enable player and missile
DMA 12 2,3
One line player resolution 16 4
Enable instructions to fetch
DMA 32 5 (see below)
LDA $311C
STA ($92),Y
INY
LDA #$00
STA ($92),Y