Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions samples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
*memory.dump
*.a65
*.lab
*.lst
*.obx
*.xex
*.exe
*.log
2 changes: 2 additions & 0 deletions samples/a8/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*memory.dump
*.xex
1 change: 1 addition & 0 deletions samples/c4plus/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.prg
Binary file removed samples/c4plus/Multipaint/hires.prg
Binary file not shown.
Binary file removed samples/c4plus/Multipaint/hires_apl.prg
Binary file not shown.
Binary file removed samples/c4plus/Multipaint/hires_apl_exo.prg
Binary file not shown.
Binary file removed samples/c4plus/Multipaint/mp.prg
Binary file not shown.
Binary file removed samples/c4plus/Multipaint/multicolor.prg
Binary file not shown.
Binary file removed samples/c4plus/Multipaint/tron.prg
Binary file not shown.
Binary file removed samples/c4plus/TEDzakker/demo.tzp.prg
Binary file not shown.
Binary file removed samples/c4plus/c4p_test.prg
Binary file not shown.
Binary file removed samples/c4plus/hello.prg
Binary file not shown.
Binary file removed samples/c4plus/plasma.prg
Binary file not shown.
Binary file removed samples/c4plus/siege/siege.prg
Binary file not shown.
Binary file removed samples/c4plus/tron-game/bin/tron_plus_4.prg
Binary file not shown.
1 change: 1 addition & 0 deletions samples/c64/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.prg
Binary file removed samples/c64/benchmark/MonteCarlo.prg
Binary file not shown.
Binary file removed samples/c64/benchmark/YoshBenchPlus.prg
Binary file not shown.
Binary file removed samples/c64/benchmark/sieve.prg
Binary file not shown.
Binary file removed samples/c64/crt/cmap.prg
Binary file not shown.
Binary file removed samples/c64/crt/colorchars.prg
Binary file not shown.
Binary file removed samples/c64/crt/hello.prg
Binary file not shown.
Binary file removed samples/c64/crt/keypressed.prg
Binary file not shown.
Binary file removed samples/c64/crt/piramid.prg
Binary file not shown.
Binary file removed samples/c64/crt/readkey.prg
Binary file not shown.
Binary file removed samples/c64/crt/snake.prg
Binary file not shown.
Binary file removed samples/c64/graph/board.prg
Binary file not shown.
Binary file removed samples/c64/graph/circle.prg
Binary file not shown.
Binary file removed samples/c64/graph/fractal_tree_float16.prg
Binary file not shown.
Binary file removed samples/c64/graph/graph_test.prg
Binary file not shown.
Binary file removed samples/c64/graph/lines.prg
Binary file not shown.
Binary file removed samples/c64/graph/snowflake.PRG
Binary file not shown.
Binary file removed samples/c64/graph/sphere.prg
Binary file not shown.
Binary file removed samples/c64/music_collection/bin/collection.prg
Binary file not shown.
Binary file removed samples/c64/pas6502_test.prg
Binary file not shown.
Binary file removed samples/c64/pic/1914/1914.prg
Binary file not shown.
Binary file removed samples/c64/pic/FantasyLand/FantasyLand.prg
Binary file not shown.
131 changes: 52 additions & 79 deletions samples/c64/sid/Play_SID.pas
Original file line number Diff line number Diff line change
@@ -1,96 +1,69 @@
{ ==================================
Demo program - SID player (c64)
Created: 12/5/2022
Song: What It Takes, by Jimmy Nielsen (Shogun)
URL: https://csdb.dk/sid/?id=57014
================================== }
SID player (C64)
================================== }
program PlaySID;
uses Commodore64;

uses crt, sysutils;

var
CIA_Interrupt : byte absolute $DC0D;
ScreenControl : byte absolute $D011;
RasterLine : byte absolute $D012;
InterruptFlag : byte absolute $D019;
InterruptMask : byte absolute $D01A;
CIAInterrupt : byte absolute $DC0D;
ScreenControl : byte absolute $D011;
RasterLine : byte absolute $D012;
InterruptFlag : byte absolute $D019;
InterruptMask : byte absolute $D01A;
BorderColor : byte absolute $D020;
BackgroundColor0 : byte absolute $D021;

IRQ: word absolute $314;
SID: array of byte = ({$BIN2CSV Test.sid});

Src, Dst, Count: word ZeroPage;
SID: array of byte = [{$BIN2CSV 'Play_SID.sid'}];

procedure CopyR;
begin
asm
LDA SID + $0A ; get address of Init
STA Dst+1
LDA SID + $0B
STA Dst
LDX Count+1 ; the last byte must be moved first
CLC ; start at the final pages of FROM and TO
TXA
ADC Src+1
STA Src+1
CLC
TXA
ADC Dst+1
STA Dst+1
INX ; allows the use of BNE after the DEX below
LDY Count
BEQ next
DEY ; move bytes on the last page first
BEQ loop2
loop1: LDA (Src),Y
STA (Dst),Y
DEY
BNE loop1
loop2: LDA (Src),Y ; handle Y = 0 separately
STA (Dst),Y
next: DEY
DEC Src+1 ; move the next page (if any)
DEC Dst+1
DEX
BNE loop1
end;
end;
Src : Word;
Dst : Word;
Size : Word;
InitAddress : Word;
PlayAddress : Word;

begin
Src := @SID + $7E;
//Dst := @SID + $7C;
Count := SID.Length - $7E;
CopyR;

CIA_Interrupt := $7F; // stops IRQs from CIA
asm
LDA SID + $0A ; get address of Init
STA init + 2
LDA SID + $0B
STA init + 1
LDA SID + $0C ; get address of Play
STA play + 2
LDA SID + $0D
STA play + 1

LDA #0 ; start with first song
init: JSR $0000 ; Init SID player

BorderColor:=0;
BackgroundColor0:=0;
WriteLn(#147#5'Doublebass (v2)');
WriteLn(#159'Aidan Crouzet-Pascal (acrouzet)');
WriteLn(#30'2021 Genesis Project');
WriteLn(#156'https://demozoo.org/music/330333');
WriteLn;

Src := Word(@SID + $7E);
Dst := SID[$7C]+256*SID[$7D];
Size := Length(SID) - $7E;
Move(Pointer(src), Pointer(Dst), Size);
WriteLn(#151'Copied $',HexStr(Size,4),' bytes from $',HexStr(Src,4),' to $',HexStr(Dst,4),'.');

InitAddress := 256*SID[$0A]+SID[$0B];
PlayAddress := 256*SID[$0C]+SID[$0D];
WriteLn(#151'Init address $',HexStr(InitAddress,4),', play address $',HexStr(PlayAddress,4),'.');
CIAInterrupt := $7F; // stops IRQs from CIA
asm
MWA InitAddress init+1 ; get address of Init
MWA PlayAddress play+1 ; get address of Play

LDA #0 ; start with the first song
init: JSR $ffff ; initialize the SID player
SEI
LDA #1
STA InterruptMask ; enable raster interrupts
LDA #$64
STA RasterLine ; raise IRQ in that line
MVA #1 InterruptMask ; enable raster interrupts
MVA #$64 RasterLine ; raise IRQ in that line
LDA ScreenControl
AND #$7F ; Clear bit 7
STA ScreenControl ; 9th bit of RasterLine
LDA #<IRQ_Handler ; Hijack IRQ vector
STA IRQ
LDA #>IRQ_Handler
STA IRQ + 1
AND #$7F ; Clear bit 7
STA ScreenControl ; 9th bit of RasterLine
MWA #IRQ_Handler IRQ ; Hijack IRQ vector
CLI
RTS


IRQ_Handler:
INC InterruptFlag ; ack the interrupt
play: JSR $0000 ; Play
JMP $EA31
INC InterruptFlag ; ack the interrupt

play: JSR $ffff ; Play
JMP $EA31
end;
end.
File renamed without changes.
Binary file removed samples/c64/sid/What_It_Takes.sid
Binary file not shown.
Binary file removed samples/c64/sprites/UpUpAndAway.prg
Binary file not shown.
2 changes: 2 additions & 0 deletions samples/minicube64/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.bin

Binary file removed samples/minicube64/cube.bin
Binary file not shown.
Binary file removed samples/minicube64/palette.bin
Binary file not shown.
Binary file removed samples/minicube64/plasma.bin
Binary file not shown.
Binary file removed samples/minicube64/twister.bin
Binary file not shown.
1 change: 1 addition & 0 deletions samples/neo6502/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.neo
Binary file not shown.
Binary file removed samples/neo6502/grapx/diamond.neo
Binary file not shown.
Binary file removed samples/neo6502/grapx/dragon.neo
Binary file not shown.
Binary file removed samples/neo6502/grapx/palette.neo
Binary file not shown.
Binary file removed samples/neo6502/grapx/snowflake.neo
Binary file not shown.
Binary file removed samples/neo6502/grapx/sphere.neo
Binary file not shown.
Binary file removed samples/neo6502/hello/hello.neo
Binary file not shown.
Binary file removed samples/neo6502/math/float_benchmark.neo
Binary file not shown.
Binary file removed samples/neo6502/math/math_test.neo
Binary file not shown.
Binary file removed samples/neo6502/neo_api/neo_api.neo
Binary file not shown.
Binary file removed samples/neo6502/slideshow/slideshow.neo
Binary file not shown.
Binary file removed samples/neo6502/text_scroll/main.neo
Binary file not shown.
Binary file removed samples/neo6502/text_scroll/text_scroll_big.neo
Binary file not shown.
Binary file removed samples/neo6502/turtle/turtle.neo
Binary file not shown.
Binary file removed samples/neo6502/uext/blink.neo
Binary file not shown.
Binary file removed samples/neo6502/vblank/main.neo
Binary file not shown.
2 changes: 2 additions & 0 deletions samples/tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*memory.dump
*.xex
1 change: 1 addition & 0 deletions samples/vic-20/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.prg