Compare commits

..

2 Commits

Author SHA1 Message Date
Aminda Suomalainen ⚧ 0beb42d64d
piraatti_intro.ras: %retab! 2023-02-18 13:16:10 +02:00
Aminda Suomalainen ⚧ 5e2e10a11c
add .editorconfig 2023-02-18 13:14:08 +02:00
20 changed files with 352 additions and 449 deletions

View File

@ -7,5 +7,5 @@ charset = utf-8
indent_style = tab
indent_size = tab
[*.md]
[*md]
trim_trailing_whitespace = false

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*.asm
*.sym
*.prg

View File

@ -8,7 +8,7 @@ zeropage_decrunch3 = $4a
zeropage_decrunch4 = $4b
pascal_settings_use_local_variables = 0
system = C64
main_ras_file = piraatti_intro.ras
main_ras_file = none
zeropage_internal1 = $4c
zeropage_internal2 = $4e
zeropage_internal3 = $50
@ -29,7 +29,7 @@ override_target_settings_org = $810
override_target_settings_ignore_sys = 0
override_target_settings_ignore_prg = 0
output_debug_symbols = 1
open_files = ,resources/images/piraattinaamat-2.flf, resources/images/piraattinaamat-1.flf, piraatti_intro.ras
open_files = ,piraatti_intro.ras
project_path = /Users/gimulnautti/piraattipuolue-github/c64-vaali-intro-2023/
zeropage_colormemory = $fb
dirart_flf_file = none
@ -40,7 +40,7 @@ remove_unused_symbols = 1
ignore_initial_jump = 0
current_file = piraatti_intro.ras
output_type = prg
exomizer_toggle = 1
exomizer_toggle = 0
use_track_19 = 1
disable_compiler_comments = 0
charset_ = :resources/character.rom
@ -77,8 +77,4 @@ override_target_settings_basic = 0
override_target_settings_sys = 0
override_target_settings_prg = 0
build_list = ,
data_header_resources/images/piraattinaamat-2.flf = 0
disk1_paw = 6.48452e-314
disk1_flf = 6.48452e-314
disk1_type = 6.48452e-314
disk1_name = piraatti_intro.d64
data_header_resources/images/piraattinaamat-2.flf = 6.42703e-314

View File

@ -3,36 +3,21 @@
Commodore 64:llä toteutettu vaalimainos vanhaan kuusnepa demoscene tyyliin
Musiikki toteutettu SIDFactory II
### Levyimagen lataaminen
1. Valitse tiedosto `commodorella_eduskuntaan.d64` ja lataa.
2. Kirjoita tikulle tai oikealle 1541 levykkeelle.
### Kääntäminen
1. Lataa [Turbo Rascal Syntax Error](https://lemonspawn.com/turbo-rascal-syntax-error-expected-but-begin/) retro-kehitysympäristö koneellesi (Win/Mac/Linux)
1. Lataa [Turbo Rascal Syntax Error](https://lemonspawn.com/turbo-rascal-syntax-error-expected-but-begin/) retro-kehitysympäristö koneellesi (Win/Max/Linux)
2. Asenna [VICE](https://vice-emu.sourceforge.io/) tai muu Commodore 64 emulaattori
3. Aseta TRSE emulaattori-asetukset
4. Avaa piraatti_intro.trse Turbo Rascal Syntax Errorissa
5. Avaa `piraaatti_intro.ras` ja aja painalla ctrl-r tai cmd-r
4. Avaa piraatti_intro.trse Turbo Rascal Syntax Errorissa ja aja ctrl-r tai cmd-r
### Oman version tekeminen
1. Valmistele 2 kpl 320x200 resoluution png-kuvatiedostoa, joissa kukin ehdokkaan naaama on 104x96 pikselin kokoisena. Oikeaan reunaan ja alareunaan pitäisi jäädä tyhjät 8 pikselin palkit jos koot ovat oikein. Katso esimerkki `naamat-esimerkki.png` tiedostosta.
1. Valmistele 2 kpl 320x200 resoluution png-kuvatiedostoa, joissa kukin ehdokkaan naaama on 104x96 pikselin kokoisena. Oikeaan reunaan ja alareunaan pitäisi jäädä tyhjät 8 pikselin palkit jos koot ovat oikein
2. Avaa `resources/images/piraattinaamat-1.flf` sekä `resources/images/piraattinaamat-2.flf`
3. Käytä import image toimintoa tuodaksesi luomasi kuvatiedostot commodore 64-muotoon
4. Avaa `piraatti_intro.ras` ja mene riville 220 josta alkaa muuttuja `naamatNames : string = (`
3. Käytä import image toimintoa tuodaksesi luomasi kuvatiedostot commodore 64-moutoon
4. Avaa piraatti_intro.ras ja mene riville 220 josta alkaa muuttuja `naamatNames : string = (`
5. Täytä ehdokkaiden nimet ja vaalipiirit
6. Mene riville 235 josta alkaa muuttuja `naamatNumbers : string = (`
7. Täytä ehdokasnumerot, ja käytä _tasan_ kolme merkkiä jokaiseen, muuten intro ei toimi!
8. Käännä ja aja tiedosto, tarkista että toimii
9. Exporttaa haluamaasi muotoon tai nauhoita video!
### Näyttäminen vaalikojulla fullscreeninä suoraan emulaattorista
1. Aja build tai run TRSEllä (ctrl-b / cmd-b)
2. Etsi projektin juuresta `piraatti_intro.prg`
3. Avaa VICE ja c64 käynnistyä
4. Jos `Preferences` valikossa on valittuna `Show menu/status in fullscreen` ota se pois päältä
5. Raahaa `piraatti_intro.prg` emulaattorin ikkunan päälle
6. Tuplanapauta emulaattorin ikkunaa siirtyäksesi fullscreeniin

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +0,0 @@
rm commodorella_eduskuntaan.d64
c1541 -format "eduskuntaan 2023,0" d64 commodorella_eduskuntaan.d64
c1541 -attach commodorella_eduskuntaan.d64 -write piraatti_intro.prg piraattipuolue
c1541 -attach commodorella_eduskuntaan.d64 -write helsinki.prg helsinki
c1541 -attach commodorella_eduskuntaan.d64 -write helsinki-uusimaa.prg helsinki-uusimaa
c1541 -attach commodorella_eduskuntaan.d64 -write muu-maa.prg muu-maa

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

View File

@ -31,7 +31,7 @@ var
@define mainFadeToText 3
mainState : byte = @mainPicture;
mainTime : integer = 0;
mainTime : integer = 0;
/*
Opening writer main variables
@ -57,13 +57,8 @@ var
@define spriteLoc $3c80
@define charSetCopyLoc $c000
charsetCopyBlock : array[1024] of byte = buildtable("0") at @charSetCopyLoc;
@define spriteBank 0
spriteCopyBlock : array[63] of byte = buildtable("0") at @spriteLoc;
lookup3Dx : array[40] of integer = buildtable("300 * (i - 20) / 200");
lookup3Dy : array[25] of integer = buildtable("300 * (i - 11) / 30");
@ -79,7 +74,7 @@ var
*/
text : string = (@cmoveto, 6,10,
"TIETOYHTEISKUNTA TARVITSEE ", @cpause,12,
"TIETOYHTEISKUNTA TARVITSEE ", @cpause,12,
@cmoveto, 10,12,
"TEKNOLOGIAPUOLUEEN ", @cpause,32,
@cstop);
@ -94,11 +89,11 @@ text : string = (@cmoveto, 6,10,
fastPlasmaSweep : array[256] of byte = buildtable("10 * (-Math.cos(2 * i * 6.28 / 256) * 0.5 + 0.5)");
textPlStartX : byte = 0;
textPlStartY : byte = 0;
textPlEndX : byte = 40;
textPlEndY : byte = 7;
textPlStartY : byte = 0;
textPlEndX : byte = 40;
textPlEndY : byte = 7;
textPlOfsX, textPlOfsY : byte = 0;
textPlAdd : byte = 0;
textPlAdd : byte = 0;
textBlinkOfs : byte = 0;
@ -171,7 +166,7 @@ text : string = (@cmoveto, 6,10,
/*
Main part
*/
@define mainpart_bitmapArea $6000 // <-- VIDEO BUFFER IS HERE!!
@define mainpart_bitmapArea $6000 // <-- VIDEO BUFFER IS HERE!!
@define piraattinaamat1_color $5200
@define piraattinaamat1_data $8000
@ -208,17 +203,17 @@ text : string = (@cmoveto, 6,10,
@piraattinaamat2_data, @piraattinaamat2_color,
@piraattinaamat2_data, @piraattinaamat2_color);
naamatCoordinates : array[] of byte = ( 0, 0, 13, 12,
naamatCoordinates : array[] of byte = ( 0, 0, 13, 12,
13, 0, 13, 12,
26, 0, 13, 12,
0, 12, 13, 12,
0, 12, 13, 12,
13, 12, 13, 12,
26, 12, 13, 12,
0, 0, 13, 12,
0, 0, 13, 12,
13, 0, 13, 12,
26, 0, 13, 12,
0, 12, 13, 12,
0, 12, 13, 12,
13, 12, 13, 12,
26, 12, 13, 12);
@ -228,29 +223,27 @@ text : string = (@cmoveto, 6,10,
"RIIKKA NIEMINEN - UUSIMAA", @cpause,
"JARI NIKKINEN - SAVO-KARJALA", @cpause,
"SATU IMMONEN - HELSINKI", @cpause,
"PEKKA MUSTONEN - SAVO-KARJALA", @cpause,
"PEKKA MUSTONEN - HELSINKI", @cpause,
"REETTA OJALA - HELSINKI", @cpause,
"MAREK NETSHADA - HELSINKI", @cpause,
"OLAVI KAUKAMIELI - HELSINKI", @cpause,
"JONI MAHLAMAKI - UUSIMAA", @cpause,
"PYRY SAARELA - VARSINAIS-SUOMI", @cpause,
"KAUSTI RANTALAINEN - HELSINKI", @cpause,
"ARI-PEKKA PULKKIS - HELSINKI", @cpause, @cstop );
"ARI-PEKKA PULKKIS - VAASA", @cpause, @cstop );
naamatNumbers : string = ( "353", "113", "356", "91 ", "-5-", " 89",
" 13", " 12", "-8-", "354", " 18", " 17", @cstop);
naamatNumbers : string = ( "123", "456", "789", " 10", "20 ", " 30",
" 40", "50 ", " 60", " 70", " 80", " 90", @cstop);
tab320 : array[25] of integer = buildtable("i*320");
tab40 : array[25] of integer = buildtable("i*40");
@define numberSpriteCopies $5e00
@define numberSpriteCopies $5800
numberSprite0loc : byte = @numberSpriteCopies / 64 + 0;
numberSprite1loc : byte = @numberSpriteCopies / 64 + 1;
numberSprite2loc : byte = @numberSpriteCopies / 64 + 2;
numberSpriteCopyBlock : array[192] of byte = buildtable("0") at @numberSpriteCopies;
numberSpriteFloatX : array[256] of byte = buildtable("Math.sin(i * (2 * 6.28 / 256)) * 7 + Math.cos(i * 6.28 / 256) * 20") at $5c00;
numberSpriteFloatY : array[256] of byte = buildtable("Math.cos(i * (3 * 6.28 / 256)) * 5") at $5d00;
numberSprite0FloatOfs : byte = 15;
@ -264,64 +257,42 @@ text : string = (@cmoveto, 6,10,
mainPartBigFont:incbin("resources/charsets/broadway_xy.bin", @mainPartBigFontLoc);
@define numMainTextPages 6
mainText : string = (
@cmoveto, 0, 3, " COMMODORELLA",
@cmoveto, 0, 4, " EDUSKUNTAAN",
@cmoveto, 0, 5, " ---------",
@cmoveto, 0, 6, " 2023",
mainText : string = ( @cmoveto, 0, 3, " COMMODORELLA ",
@cmoveto, 0, 4, " EDUSKUNTAAN ",
@cmoveto, 0, 5, " 2023 ",
@cpage,
@cmoveto, 0, 2, " RADIKAALISTI",
@cmoveto, 0, 3, " AVOINTA",
@cmoveto, 0, 4, " DEMOKRATIAA",
@cmoveto, 0, 5, " VALTIONHALLINNON",
@cmoveto, 0, 6, " LIVESTREAMAUS",
@cmoveto, 0, 7, " LAHTOKOHTAISESTI",
@cmoveto, 0, 2, " RADIKAALISTI ",
@cmoveto, 0, 3, " AVOINTA ",
@cmoveto, 0, 4, " DEMOKRATIAA ",
@cmoveto, 0, 5, " VALTIONHALLINNON ",
@cmoveto, 0, 6, " LIVESTREAMAUS ",
@cmoveto, 0, 7, " LAHTOKOHTAISESTI ",
@cpage,
@cmoveto, 0, 2, " LOBBAUS NAKYVAKSI",
@cmoveto, 0, 3, "LAAJA JULKISUUSLAKI",
@cmoveto, 0, 4, " KANSANAANESTYS",
@cmoveto, 0, 5, " PERUSOIKEUDET",
@cmoveto, 0, 6, "YKSITYISYYDENSUOJA",
@cmoveto, 0, 7, " YHDENVERTAISUUS",
@cmoveto, 0, 2, " LOBBAUS NAKYVAKSI ",
@cmoveto, 0, 3, " LAAJA JULKISUUSLAKI",
@cmoveto, 0, 4, "KANSANAANESTYSALOITE",
@cmoveto, 0, 5, " RAHANKERAYSLAIN ",
@cmoveto, 0, 6, " UUDISTUS ",
@cmoveto, 0, 7, " PERUSTULO ",
@cpage,
@cmoveto, 0, 2, " KESTAVYYSSIIRTYMA",
@cmoveto, 0, 3, " VETYTALOUDEN",
@cmoveto, 0, 4, " TEKNOLOGIATUKI",
@cmoveto, 0, 5, "PAIKALLISDEMOKRATIA",
@cmoveto, 0, 6, " LUONTO MAANKAYTTO",
@cmoveto, 0, 7, " KESTAVYYS",
@cmoveto, 0, 2, " PERUSOIKEUDET ",
@cmoveto, 0, 3, " YKSITYISYYDENSUOJA ",
@cmoveto, 0, 4, " YHDENVERTAISUUS ",
@cmoveto, 0, 5, " KESTAVYYSSIIRTYMA ",
@cmoveto, 0, 6, " VETYTALOUDEN ",
@cmoveto, 0, 7, " TEKNOLOGIATUKI ",
@cpage,
@cmoveto, 0, 3, "HYVINVOINTIALUEIDEN",
@cmoveto, 0, 4, " VERONKANTO-OIKEUS",
@cmoveto, 0, 5, " RAHANKERAYSLAIN",
@cmoveto, 0, 6, " UUDISTUS",
@cmoveto, 0, 7, " PERUSTULO",
@cmoveto, 0, 2, " HYVINVOINTIALUEIDEN",
@cmoveto, 0, 3, " VERONKANTO-OIKEUS ",
@cmoveto, 0, 4, "PAIKALLISDEMOKRATIAN",
@cmoveto, 0, 5, " VAHVISTAMINEN ",
@cmoveto, 0, 6, " LUONTO MAANKAYTTO ",
@cmoveto, 0, 7, " KESTAVYYS ",
@cpage,
@cmoveto, 0, 2, " TAVOITTEELLINEN",
@cmoveto, 0, 3, " TUTKIMUS- JA",
@cmoveto, 0, 4, " INNOVAATIO-",
@cmoveto, 0, 5, " POLITIIKKA",
@cmoveto, 0, 6, " TYOPERAINEN",
@cmoveto, 0, 7, " MAAHANMUUTTO",
@cpage,
@cmoveto, 0, 2, " LAPINAKYVAT JA",
@cmoveto, 0, 3, " TURVALLISET",
@cmoveto, 0, 4, " JULKISET",
@cmoveto, 0, 5, " TIETOJARJESTELMAT",
@cmoveto, 0, 6, " OSTO-OSAAMISTA",
@cmoveto, 0, 7, " YKSITYISTAMISEEN",
@cpage,
@cmoveto, 0, 2, " ANONYMISOIDUT",
@cmoveto, 0, 3, " OPEN ACCESS",
@cmoveto, 0, 4, " TIETOKANNAT",
@cmoveto, 0, 5, " JULKISHALLINTO",
@cmoveto, 0, 6, "TIETEEN TEKNOLOGIAN",
@cmoveto, 0, 7, " MOOTTORINA",
@cpage,
@cmoveto, 0, 3, " TIETOPOLITIIKAN",
@cmoveto, 0, 4, " VAKIINNUTTAMINEN",
@cmoveto, 0, 5, " OSAKSI HALLINTO-",
@cmoveto, 0, 6, " RAKENNETTA",
@cmoveto, 0, 3, " TIETOPOLITIIKAN ",
@cmoveto, 0, 4, " VAKIINNUTTAMINEN ",
@cmoveto, 0, 5, " OSAKSI HALLINTO- ",
@cmoveto, 0, 6, " RAKENNETTA ",
@cpage, @cstop);
mainPartAddressTable : array[25] of integer;
@ -341,7 +312,7 @@ text : string = (@cmoveto, 6,10,
rasterLineMainScroller : byte = 240;
// TODO optimize spaces
scrollText : string = " YARRRR SAILORS WELCOME TO THE FINNISH PIRATE PARTY PARLIAMENTARY ELECTION 2023 INTRO --- VOTE FOR US --- WE ROCK THE WORLD IN 8 BITS AND BEYOND --- WRITTEN BY GIMLE IN TRSE --- MUSIC BY GIMLE WITH SIDFACTORY II --- MUCH LOVE AND GREETINGS TO THE C64 DEMOSCENE --- WE SALUTE SOME GROUNDBREAKING TECHNOLOGICAL PIRATES --- FINNISH GOLD - EXTEND - VIRTUAL DREAMS - FAIRLIGHT - BYTERAPERS - BLOODSUCKERS - ARTLINE DESIGNS - DEKADENCE - BOOZE DESIGN - ACCESSION - NOICE - PROXIMA - ORANGE - CNCD - KEWLERS - MFX - TPOLM - MATUREFURK - KATASTRO FI - PARALLAX - TAAT - HEDELMAE - JUMALAUTA - KAITA FILMITUOTANTO - BRAINLEZ CODERS - SYMPTOM - GOTO 10 - DAMONES - DA JORMAS - WIDE LOAD - HIRMU - LEUAT ";
scrollText : string = " YARRRR SAILORS WELCOME TO THE FINNISH PIRATE PARTY PARLIAMENTARY ELECTION 2023 INTRO --- VOTE FOR US --- WE ROCK THE WORLD IN 8 BITS AND BEYOND --- WRITTEN BY GIMLE IN TRSE --- MUSIC BY GIMLE IN SIDFACTORY II --- MUCH LOVE AND GREETINGS TO THE C64 DEMOSCENE --- WE SALUTE SOME GROUNDBREAKING TECHNOLOGICAL PIRATES --- FINNISH GOLD - EXTEND - VIRTUAL DREAMS - FAIRLIGHT - BYTERAPERS - BLOODSUCKERS - ARTLINE DESIGNS - DEKADENCE - BOOZE DESIGN - ACCESSION - NOICE - PROXIMA - ORANGE - CNCD - KEWLERS - MFX - TPOLM - MATUREFURK - KATASTRO FI - SCOOPEX - TAAT - HEDELMAE - JUMALAUTA - KAITA FILMITUOTANTO - BRAINLEZ CODERS - SYMPTOM - GOTO 10 - DAMONES - DA JORMAS - WIDE LOAD - HIRMU --- ";
scrollTextOffset : integer = 0;
scrollTextLength : integer = 0;
scrollCurrent : byte = 0;
@ -363,16 +334,6 @@ text : string = (@cmoveto, 6,10,
tempPtr1, tempPtr2 : pointer;
tempInt : integer;
/*
Workloads for main loop
*/
@define notWorking 0
@define mainText 1
@define mainPicture 2
mainWorkState : byte = 0;
//===========================================================================================================
// Raster interrupt forward declarations
//===========================================================================================================
@ -412,21 +373,34 @@ begin
RasterIrq(RasterMainPartScroller(), rasterLineMainScroller, @useKernal);
end;
//===========================================================================================================
// Main Work state functions
//===========================================================================================================
function isMainWorking() : boolean;
var result : boolean;
/**
* Assembly setup for a character set copy in RAM
*/
procedure CopyCharsetRomToRam(targetHi : byte);
begin
if (mainWorkState = @notWorking) then result := false
else result := true;
isMainWorking := result;
end;
asm("
ldx #$08 ; we loop 8 times (8x255 = 2Kb)
lda #$33 ; make the CPU see the Character Generator ROM...
sta $01 ; ...at $D000 by storing %00110011 into location $01
lda #$d0 ; load high byte of $D000
sta $fc ; store it in a free location we use as vector
ldy #$00 ; init counter with 0
sty $fb ; store it as low byte in the $FB/$FC vector
lda $fd ; second pair in $FD/$FE
lda targetHi ; point to target
sta $fe
procedure startMainWork(s : byte);
begin
mainWorkState := s;
loopc lda ($fb),y ; read byte from vector stored in $fb/$fc
sta ($fd),y ; write to the RAM
iny ; do this 255 times...
bne loopc ; ..for low byte $00 to $FF
inc $fc ; when we passed $FF increase high byte...
inc $fe
dex ; ... and decrease X by one before restart
bne loopc ; We repeat this until X becomes Zero
lda #$37 ; switch in I/O mapped registers again...
sta $01 ; ... with %00110111 so CPU can see them
");
end;
/**
@ -448,14 +422,14 @@ var
begin
while (char > 64) do char -= 64;
charsetptr += char * 8;
tempPtr1 := charsetptr + char * 8;
for k:=0 to 8 do begin
temp[0] := 0;
temp[1] := 0;
temp[2] := 0;
for i:=0 to 10 do begin
charTemp := charsetptr[0] & chrBitMask[sprChrBit[i]];
charTemp := tempPtr1[0] & chrBitMask[sprChrBit[i]];
sprOfsTemp := sprOffset[i];
if charTemp then temp[sprOfsTemp] := temp[sprOfsTemp] | sprBitMask[i];
end;
@ -465,7 +439,7 @@ begin
sPtr[2] := temp[2];
sPtr += 3;
end;
charsetptr += 1;
tempPtr1 += 1;
end;
end;
@ -588,14 +562,14 @@ begin
10, // Volume
Random()/128 + 5, // Hi byte frequency
0*16+0, // Attack voice 1
15*16 + 3, // Sustain = 16*15 + release=6
15*16 + 3, // Sustain = 16*15 + release=6
1 +sid_noise, // Waveform
sid_noise); // waveform
PlaySound(sid_channel2,
13, // Volume
6, // Hi byte frequency
6, // Hi byte frequency
0*16+0, // Attack voice 1
4*16 + 3, // Sustain = 16*15 + release=6
4*16 + 3, // Sustain = 16*15 + release=6
1 + sid_tri, // Waveform
sid_tri); // waveform
end;
@ -629,7 +603,7 @@ begin
begin
if (tp[0] = @cmoveto) then
begin
x := tp[1] * 2 + 1;
x := tp[1] * 2;
y := tp[2] * 3 - 1;
sp := AddressTable(#mainPartAddressTable, x, y);
tp += 3;
@ -778,7 +752,7 @@ begin
tempPtr2 += 320;
end;
// color data #1
// color data #1
tempPtr2 := #screen_char_loc2;
tempPtr2 += toY2 * 40 + toX2;
@ -956,7 +930,7 @@ end;
interrupt RasterText();
begin
startIRQ(@useKernal);
UpdateText();
if (currentTime > 50) then UpdateText();
closeIRQ();
GoToMainRaster();
end;
@ -1085,7 +1059,6 @@ begin
begin
purpleBounceOfs := 0;
spriteBounceOfs := 0;
spriteWobbleOfs := 245;
end;
if (part = @partMain) then
begin
@ -1128,8 +1101,6 @@ begin
numLinesPtr := #numLines2;
hideborderx(1); // avoid choppy scroll
InitMainPart();
end;
end;
@ -1147,19 +1118,53 @@ begin
if (mainState = @mainShowText) then
begin
startMainWork(@mainText);
//tempPtr1 := #screen_char_loc2 + 840;
Fill(^$4740, 0, 80);
//tempPtr1 := #screen_col_loc + 800;
FillFast(^$DB20, 0, 80);
WriteMainText();
if (tp[0] = @cstop) then tp := #mainText; // back to first page when done
//tempPtr2 := #screen_col_loc + 960; // keep color for scroll text
fillfast(^$DBC0, $a, 40);
end;
if (mainState = @mainPicture) then
begin
startMainWork(@mainPicture);
setmulticolormode();
setbitmapmode();
//tempPtr1 := AddressTable(#colorAddressTable, 0, 21);
FillFast(^$4748, 0, 120);
//tempPtr2 := #screen_col_loc + 960; // keep color for scroll text
fillfast(^$DBC0, $a, 40);
// set current picture
currentNaamaX := naamatCoordinates[currentNaama * 4];
currentNaamaY := naamatCoordinates[currentNaama * 4 + 1];
currentNaamaWidth := naamatCoordinates[currentNaama * 4 + 2];
currentNaamaHeight := naamatCoordinates[currentNaama * 4 + 3];
// todo write these in main loop instead of raster interrupt
PrintCharToSprite(numbersPtr[0], @mainPartSmallFontLoc, @numberSpriteCopies);
PrintCharToSprite(numbersPtr[1], @mainPartSmallFontLoc, @numberSpriteCopies + 64);
PrintCharToSprite(numbersPtr[2], @mainPartSmallFontLoc, @numberSpriteCopies + 128);
numbersPtr += 3;
if (numbersPtr[0] = @cstop) then numbersPtr := #naamatNumbers;
// print the name
WriteMainName();
if (namesPtr[1] = @cstop) then namesPtr := #naamatNames;
plasmaHeight := 2;
end;
end;
procedure UpdateMainPart();
begin
if (mainState = @mainShowText and not isMainWorking()) then
if (mainState = @mainShowText) then
begin
textPlStartX := 0;
i := lo(textFade);
@ -1172,7 +1177,6 @@ begin
if (mod(textFade, 10) = 0) then inc(plasmaHeight);
if (plasmaHeight > 9) then plasmaHeight := 9;
end;
if (mainState = @mainFadeToPicture and textFade < 210) then
begin
i := lo(textFade);
@ -1192,18 +1196,7 @@ begin
inc(textFade);
end;
if (mainState = @mainPicture) then
if (isMainWorking()) then
begin
sprite_color[0]:=0;
sprite_color[1]:=0;
sprite_color[2]:=0;
sprite_color[3]:=0;
sprite_color[4]:=0;
sprite_color[5]:=0;
end
else
begin
// copy picture one row at a time
if (pictureFade < currentNaamaHeight) then
@ -1248,7 +1241,6 @@ begin
memcpyfast(#textFadeLumi, 0, tempPtr1, 20);
end;
end;
if (mainState = @mainFadeToText) then
begin
// blank out picture one row at a time
@ -1274,9 +1266,9 @@ begin
sprite_color[0]:=0;
sprite_color[1]:=0;
sprite_color[2]:=0;
sprite_color[3]:=0;
sprite_color[4]:=0;
sprite_color[5]:=0;
sprite_color[3]:=$0;
sprite_color[4]:=$0;
sprite_color[5]:=$0;
end;
if (mainTime > 50 and nameFade < 150) then
@ -1319,7 +1311,6 @@ var lastSpriteWoblOfs : byte;
wobblePause : boolean = false;
wobblePauseTimer : integer = 0;
cEqualsChangeFlag : boolean = false;
fillPart : byte = 0;
begin
if (part >= @partOpenBar) then Call(SIDFILE_1_PLAY);
@ -1331,11 +1322,6 @@ begin
purpleBarEndRasterLine := purpleBarCenter + purpleBarBounce[purpleBounceOfs] + 1;
RasterIRQ(RasterTextPlasma(), 0, @useKernal);
inc(purpleBounceOfs);
if (purpleBounceOfs = 10) then FillFast(screen_char_loc + 640, KEY_SPACE, 40);
if (purpleBounceOfs = 50) then FillFast(screen_char_loc + 600, KEY_SPACE, 40);
if (purpleBounceOfs = 50) then FillFast(screen_char_loc + 680, KEY_SPACE, 40);
if (purpleBounceOfs = 120) then FillFast(screen_char_loc + 560, KEY_SPACE, 40);
if (purpleBounceOfs = 120) then FillFast(screen_char_loc + 720, KEY_SPACE, 40);
if (purpleBounceOfs >= @purpleBarBounceSize) then currentPartDone := true;
end;
@ -1361,35 +1347,25 @@ begin
fadeOfsCurrent := 0;
end;
end;
if (fadeStateCurrent = @fadeStateText) then
if (fadeStateCurrent = @fadeStateText) then
begin
fadeTemp := textFadeLumi[fadeOfsCurrent];
if (fillPart = 0) then
begin
Fill(screen_col_loc, fadeTemp, 255);
FillFast(screen_col_loc + 256, fadeTemp, 127);
fadeOfsCurrent -= 1;
end;
if (fillPart = 1) then
begin
Fill(screen_col_loc + 511, fadeTemp, 255);
Fill(screen_col_loc + 766, fadeTemp, 234);
end;
Fill(screen_col_loc, fadeTemp, 255);
FillFast(screen_col_loc + 256, fadeTemp, 127);
Fill(screen_col_loc + 512, fadeTemp, 255);
Fill(screen_col_loc + 768, fadeTemp, 232);
GoToPurpleBarRasterStart();
if (fadeOfsCurrent >= @textFadeLumiLast) then
begin
fadeStateCurrent := @fadeStateAll;
fadeOfsCurrent := 0;
end;
inc(fillPart);
if (fillPart = 2) then fillPart := 0;
end;
if (fadeStateCurrent = @fadeStateAll) then
begin
fgColBefore := 0;
Fill(screen_char_loc, KEY_SPACE, 255);
FillFast(screen_char_loc + 255, KEY_SPACE, 127);
Fill(^$06F8, KEY_SPACE, 240);
FillFast(screen_char_loc + 256, KEY_SPACE, 127);
GoToPurpleBarRasterStart();
currentPartDone := true;
screen_fg_col := 0;
@ -1469,7 +1445,7 @@ begin
if (mainState = @mainFadeToPicture and mainTime > 200) then GoToNextMainPart();
if (mainState = @mainFadeToText and mainTime > 100) then GoToNextMainPart();
if (mainState = @mainPicture and mainTime > 650) then GoToNextMainPart();
if (mainState = @mainShowText and mainTime > 500) then GoToNextMainPart();
if (mainState = @mainShowText and mainTime > 400) then GoToNextMainPart();
GoToPurpleBarRasterStart();
end;
@ -1502,7 +1478,7 @@ begin
fgColBefore := screen_fg_col;
DisableCIAInterrupts();
CopyCharSetFromRom(^$c000);
CopyCharsetRomToRam($c0);
setmemoryconfig(1,@useKernal,0);
@ -1522,8 +1498,7 @@ begin
CreateAddressTable(#mainPartAddressTable, $4400, 40, 25);
CreateAddressTable(#colorAddressTable, $d800, 40, 25);
Fill(^$0518, KEY_SPACE, 240);
Fill(^$0608, KEY_SPACE, 80);
Fill(^$0568, KEY_SPACE, 200);
for i := 0 to 256 do fastPlasma[i] := textPlasmaLumi[textPlasmaX[i]];
@ -1535,53 +1510,5 @@ begin
EnableRasterIRQ();
enableirq();
while (true) do
begin
// Heavy main loop work tasks here
if (mainWorkState = @mainText) then
begin
//tempPtr1 := #screen_char_loc2 + 840;
Fill(^$4740, 0, 80);
//tempPtr1 := #screen_col_loc + 800;
FillFast(^$DB20, 0, 80);
WriteMainText();
if (tp[0] = @cstop) then tp := #mainText; // back to first page when done
//tempPtr2 := #screen_col_loc + 960; // keep color for scroll text
fillfast(^$DBC0, $a, 40);
mainWorkState := @notWorking;
end;
if (mainWorkState = @mainPicture) then
begin
//tempPtr1 := AddressTable(#colorAddressTable, 0, 21);
FillFast(^$4748, 0, 120);
//tempPtr2 := #screen_col_loc + 960; // keep color for scroll text
fillfast(^$DBC0, $a, 40);
// set current picture
currentNaamaX := naamatCoordinates[currentNaama * 4];
currentNaamaY := naamatCoordinates[currentNaama * 4 + 1];
currentNaamaWidth := naamatCoordinates[currentNaama * 4 + 2];
currentNaamaHeight := naamatCoordinates[currentNaama * 4 + 3];
PrintCharToSprite(numbersPtr[0], @mainPartSmallFontLoc, @numberSpriteCopies);
PrintCharToSprite(numbersPtr[1], @mainPartSmallFontLoc, @numberSpriteCopies + 64);
PrintCharToSprite(numbersPtr[2], @mainPartSmallFontLoc, @numberSpriteCopies + 128);
numbersPtr += 3;
if (numbersPtr[0] = @cstop) then numbersPtr := #naamatNumbers;
// print the name
WriteMainName();
if (namesPtr[0] = @cstop) then namesPtr := #naamatNames;
plasmaHeight := 2;
mainWorkState := @notWorking;
end;
end;
Loop();
end.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Binary file not shown.