the helicopter propeller is moved by the interrupt.
start from disk.d64 : intschiebe.p
start sys8192 and control with A /S /D / W. helicopter-color :R /F motor-on : T motor-off : G
I wrote the interrupt myself in asm.
how can you use the interrupt from em trse for this?
greeting
Code: Select all
program schiebeint;
var
charset : array[8] of byte = ( 24,24,60,126,255,24,36,66);
charset1 : array[8] of byte = (255,129,129,129,129,129,129,255 );
a,b,f,ch,x,y : byte;
saddr : array[23] of integer;
caddr : array[23] of integer;
zpcharz: pointer;
procedure warte(t : byte);
begin
for a:=0 to t do
begin
wait(100);
end;
end;
procedure setint();
begin
asm("
sei
lda #<irq
sta $0314
lda #>irq
sta $0315
cli
");
end;
procedure endeint();
begin
asm("
sei
lda #<irq1
sta $0314
lda #>irq1
sta $0315
cli
");
end;
procedure irq();
begin
asm("
bne .exit
ldx #0
drehe1
lda #255
sta 5120
inx
cpx #255
bne drehe1
ldx #0
drehe2
lda #126
sta 5120
inx
cpx #255
bne drehe2
ldx #0
drehe3
lda #60
sta 5120
inx
cpx #255
bne drehe3
ldx #0
drehe4
lda #24
sta 5120
inx
cpx #255
bne drehe4
.exit
jmp $eabf
");
end;
procedure irq1();
begin
asm("
bne .exit1
.exit1
jmp $eabf
");
end;
begin
definescreen();
ClearScreen(white, screen_col_loc);
CreateAddressTable( saddr,$1000, 22, 23);
CreateAddressTable( caddr,$9400, 22, 23);
zpcharz:=5120;
poke(^37139,0,0);
poke(^37154,0,127);
poke(^36869,0,205);
zpcharz:=5120;
for b:=0 to 8 do
begin
zpcharz[b]:=charset[b];
end;
zpcharz:=5128;
for b:=0 to 8 do
begin
zpcharz[b]:=charset1[b];
end;
x:=10;
y:=10;
f:=5;
ch:=0;
screenmemory := AddressTable( saddr,x,y );
screenmemory[0] := ch;
screenmemory := AddressTable( caddr,x, y );
screenmemory[0] := f;
while (true) do
begin
waitforraster(0);
if peek(^197,0)= 18 then
begin
warte(5);
x:=x+1;
if (x>21) then x:=21;
ch:=0;
screenmemory := AddressTable( saddr,x, y );
screenmemory[0] := ch;
screenmemory := AddressTable( caddr,x, y );
screenmemory[0] := f;
ch:=32;
screenmemory := AddressTable( saddr,x-1, y );
screenmemory[0] := ch;
end;
if peek(^197,0)= 17 then
begin
warte(5);
x:=x-1;
if (x=255) then x:=0;
ch:=0;
screenmemory := AddressTable( saddr,x, y );
screenmemory[0] := ch;
screenmemory := AddressTable( caddr,x, y );
screenmemory[0] := f;
ch:=32;
screenmemory := AddressTable( saddr,x+1, y );
screenmemory[0] := ch;
end;
if peek(^197,0)= 41 then
begin
warte(5);
y:=y+1;
if (y>22) then y:=22;
ch:=0;
screenmemory := AddressTable( saddr,x, y );
screenmemory[0] := ch;
screenmemory := AddressTable( caddr,x, y );
screenmemory[0] := f;
ch:=32;
screenmemory := AddressTable( saddr,x, y-1 );
screenmemory[0] := ch;
end;
if peek(^197,0)= 9 then
begin
warte(5);
y:=y-1;
if (y=255) then y:=0;
ch:=0;
screenmemory := AddressTable( saddr,x, y );
screenmemory[0] := ch;
screenmemory := AddressTable( caddr,x, y );
screenmemory[0] := f;
ch:=32;
screenmemory := AddressTable( saddr,x, y+1 );
screenmemory[0] := ch;
end;
if peek(^197,0)= 10 then
begin
warte(10);
f:=f+1;
if (f>7) then f:=7;
screenmemory := AddressTable( caddr,x, y );
screenmemory[0] := f;
end;
if peek(^197,0)= 42 then
begin
warte(10);
f:=f-1;
if (f=255) then f:=0;
screenmemory := AddressTable( caddr,x, y );
screenmemory[0] := f;
end;
if peek(^197,0)= 50 then
begin
warte(10);
setint();
end;
if peek(^197,0)= 19 then
begin
warte(10);
endeint();
end;
end;
end.