Compare commits

..

No commits in common. "master" and "gitattributes" have entirely different histories.

20 changed files with 130 additions and 238 deletions

View File

@ -1,11 +0,0 @@
root = true
[*]
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
indent_style = tab
indent_size = tab
[*.md]
trim_trailing_whitespace = false

1
.gitignore vendored
View File

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

View File

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

View File

@ -3,36 +3,21 @@
Commodore 64:llä toteutettu vaalimainos vanhaan kuusnepa demoscene tyyliin Commodore 64:llä toteutettu vaalimainos vanhaan kuusnepa demoscene tyyliin
Musiikki toteutettu SIDFactory II Musiikki toteutettu SIDFactory II
### Levyimagen lataaminen
1. Valitse tiedosto `commodorella_eduskuntaan.d64` ja lataa.
2. Kirjoita tikulle tai oikealle 1541 levykkeelle.
### Kääntäminen ### 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 2. Asenna [VICE](https://vice-emu.sourceforge.io/) tai muu Commodore 64 emulaattori
3. Aseta TRSE emulaattori-asetukset 3. Aseta TRSE emulaattori-asetukset
4. Avaa piraatti_intro.trse Turbo Rascal Syntax Errorissa 4. Avaa piraatti_intro.trse Turbo Rascal Syntax Errorissa ja aja ctrl-r tai cmd-r
5. Avaa `piraaatti_intro.ras` ja aja painalla ctrl-r tai cmd-r
### Oman version tekeminen ### 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` 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 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 = (` 4. Avaa piraatti_intro.ras ja mene riville 220 josta alkaa muuttuja `naamatNames : string = (`
5. Täytä ehdokkaiden nimet ja vaalipiirit 5. Täytä ehdokkaiden nimet ja vaalipiirit
6. Mene riville 235 josta alkaa muuttuja `naamatNumbers : string = (` 6. Mene riville 235 josta alkaa muuttuja `naamatNumbers : string = (`
7. Täytä ehdokasnumerot, ja käytä _tasan_ kolme merkkiä jokaiseen, muuten intro ei toimi! 7. Täytä ehdokasnumerot, ja käytä _tasan_ kolme merkkiä jokaiseen, muuten intro ei toimi!
8. Käännä ja aja tiedosto, tarkista että toimii 8. Käännä ja aja tiedosto, tarkista että toimii
9. Exporttaa haluamaasi muotoon tai nauhoita video! 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

@ -57,13 +57,8 @@ var
@define spriteLoc $3c80 @define spriteLoc $3c80
@define charSetCopyLoc $c000 @define charSetCopyLoc $c000
charsetCopyBlock : array[1024] of byte = buildtable("0") at @charSetCopyLoc;
@define spriteBank 0 @define spriteBank 0
spriteCopyBlock : array[63] of byte = buildtable("0") at @spriteLoc;
lookup3Dx : array[40] of integer = buildtable("300 * (i - 20) / 200"); lookup3Dx : array[40] of integer = buildtable("300 * (i - 20) / 200");
lookup3Dy : array[25] of integer = buildtable("300 * (i - 11) / 30"); lookup3Dy : array[25] of integer = buildtable("300 * (i - 11) / 30");
@ -228,29 +223,27 @@ text : string = (@cmoveto, 6,10,
"RIIKKA NIEMINEN - UUSIMAA", @cpause, "RIIKKA NIEMINEN - UUSIMAA", @cpause,
"JARI NIKKINEN - SAVO-KARJALA", @cpause, "JARI NIKKINEN - SAVO-KARJALA", @cpause,
"SATU IMMONEN - HELSINKI", @cpause, "SATU IMMONEN - HELSINKI", @cpause,
"PEKKA MUSTONEN - SAVO-KARJALA", @cpause, "PEKKA MUSTONEN - HELSINKI", @cpause,
"REETTA OJALA - HELSINKI", @cpause, "REETTA OJALA - HELSINKI", @cpause,
"MAREK NETSHADA - HELSINKI", @cpause, "MAREK NETSHADA - HELSINKI", @cpause,
"OLAVI KAUKAMIELI - HELSINKI", @cpause, "OLAVI KAUKAMIELI - HELSINKI", @cpause,
"JONI MAHLAMAKI - UUSIMAA", @cpause, "PYRY SAARELA - VARSINAIS-SUOMI", @cpause,
"KAUSTI RANTALAINEN - HELSINKI", @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", naamatNumbers : string = ( "123", "456", "789", " 10", "20 ", " 30",
" 13", " 12", "-8-", "354", " 18", " 17", @cstop); " 40", "50 ", " 60", " 70", " 80", " 90", @cstop);
tab320 : array[25] of integer = buildtable("i*320"); tab320 : array[25] of integer = buildtable("i*320");
tab40 : array[25] of integer = buildtable("i*40"); tab40 : array[25] of integer = buildtable("i*40");
@define numberSpriteCopies $5e00 @define numberSpriteCopies $5800
numberSprite0loc : byte = @numberSpriteCopies / 64 + 0; numberSprite0loc : byte = @numberSpriteCopies / 64 + 0;
numberSprite1loc : byte = @numberSpriteCopies / 64 + 1; numberSprite1loc : byte = @numberSpriteCopies / 64 + 1;
numberSprite2loc : byte = @numberSpriteCopies / 64 + 2; 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; 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; numberSpriteFloatY : array[256] of byte = buildtable("Math.cos(i * (3 * 6.28 / 256)) * 5") at $5d00;
numberSprite0FloatOfs : byte = 15; numberSprite0FloatOfs : byte = 15;
@ -264,64 +257,42 @@ text : string = (@cmoveto, 6,10,
mainPartBigFont:incbin("resources/charsets/broadway_xy.bin", @mainPartBigFontLoc); mainPartBigFont:incbin("resources/charsets/broadway_xy.bin", @mainPartBigFontLoc);
@define numMainTextPages 6 @define numMainTextPages 6
mainText : string = ( mainText : string = ( @cmoveto, 0, 3, " COMMODORELLA ",
@cmoveto, 0, 3, " COMMODORELLA", @cmoveto, 0, 4, " EDUSKUNTAAN ",
@cmoveto, 0, 4, " EDUSKUNTAAN", @cmoveto, 0, 5, " 2023 ",
@cmoveto, 0, 5, " ---------",
@cmoveto, 0, 6, " 2023",
@cpage, @cpage,
@cmoveto, 0, 2, " RADIKAALISTI", @cmoveto, 0, 2, " RADIKAALISTI ",
@cmoveto, 0, 3, " AVOINTA", @cmoveto, 0, 3, " AVOINTA ",
@cmoveto, 0, 4, " DEMOKRATIAA", @cmoveto, 0, 4, " DEMOKRATIAA ",
@cmoveto, 0, 5, " VALTIONHALLINNON", @cmoveto, 0, 5, " VALTIONHALLINNON ",
@cmoveto, 0, 6, " LIVESTREAMAUS", @cmoveto, 0, 6, " LIVESTREAMAUS ",
@cmoveto, 0, 7, " LAHTOKOHTAISESTI", @cmoveto, 0, 7, " LAHTOKOHTAISESTI ",
@cpage, @cpage,
@cmoveto, 0, 2, " LOBBAUS NAKYVAKSI", @cmoveto, 0, 2, " LOBBAUS NAKYVAKSI ",
@cmoveto, 0, 3, "LAAJA JULKISUUSLAKI", @cmoveto, 0, 3, " LAAJA JULKISUUSLAKI",
@cmoveto, 0, 4, " KANSANAANESTYS", @cmoveto, 0, 4, "KANSANAANESTYSALOITE",
@cmoveto, 0, 5, " PERUSOIKEUDET", @cmoveto, 0, 5, " RAHANKERAYSLAIN ",
@cmoveto, 0, 6, "YKSITYISYYDENSUOJA", @cmoveto, 0, 6, " UUDISTUS ",
@cmoveto, 0, 7, " YHDENVERTAISUUS", @cmoveto, 0, 7, " PERUSTULO ",
@cpage, @cpage,
@cmoveto, 0, 2, " KESTAVYYSSIIRTYMA", @cmoveto, 0, 2, " PERUSOIKEUDET ",
@cmoveto, 0, 3, " VETYTALOUDEN", @cmoveto, 0, 3, " YKSITYISYYDENSUOJA ",
@cmoveto, 0, 4, " TEKNOLOGIATUKI", @cmoveto, 0, 4, " YHDENVERTAISUUS ",
@cmoveto, 0, 5, "PAIKALLISDEMOKRATIA", @cmoveto, 0, 5, " KESTAVYYSSIIRTYMA ",
@cmoveto, 0, 6, " LUONTO MAANKAYTTO", @cmoveto, 0, 6, " VETYTALOUDEN ",
@cmoveto, 0, 7, " KESTAVYYS", @cmoveto, 0, 7, " TEKNOLOGIATUKI ",
@cpage, @cpage,
@cmoveto, 0, 3, "HYVINVOINTIALUEIDEN", @cmoveto, 0, 2, " HYVINVOINTIALUEIDEN",
@cmoveto, 0, 4, " VERONKANTO-OIKEUS", @cmoveto, 0, 3, " VERONKANTO-OIKEUS ",
@cmoveto, 0, 5, " RAHANKERAYSLAIN", @cmoveto, 0, 4, "PAIKALLISDEMOKRATIAN",
@cmoveto, 0, 6, " UUDISTUS", @cmoveto, 0, 5, " VAHVISTAMINEN ",
@cmoveto, 0, 7, " PERUSTULO", @cmoveto, 0, 6, " LUONTO MAANKAYTTO ",
@cmoveto, 0, 7, " KESTAVYYS ",
@cpage, @cpage,
@cmoveto, 0, 2, " TAVOITTEELLINEN", @cmoveto, 0, 3, " TIETOPOLITIIKAN ",
@cmoveto, 0, 3, " TUTKIMUS- JA", @cmoveto, 0, 4, " VAKIINNUTTAMINEN ",
@cmoveto, 0, 4, " INNOVAATIO-", @cmoveto, 0, 5, " OSAKSI HALLINTO- ",
@cmoveto, 0, 5, " POLITIIKKA", @cmoveto, 0, 6, " RAKENNETTA ",
@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",
@cpage, @cstop); @cpage, @cstop);
mainPartAddressTable : array[25] of integer; mainPartAddressTable : array[25] of integer;
@ -341,7 +312,7 @@ text : string = (@cmoveto, 6,10,
rasterLineMainScroller : byte = 240; rasterLineMainScroller : byte = 240;
// TODO optimize spaces // 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; scrollTextOffset : integer = 0;
scrollTextLength : integer = 0; scrollTextLength : integer = 0;
scrollCurrent : byte = 0; scrollCurrent : byte = 0;
@ -363,16 +334,6 @@ text : string = (@cmoveto, 6,10,
tempPtr1, tempPtr2 : pointer; tempPtr1, tempPtr2 : pointer;
tempInt : integer; tempInt : integer;
/*
Workloads for main loop
*/
@define notWorking 0
@define mainText 1
@define mainPicture 2
mainWorkState : byte = 0;
//=========================================================================================================== //===========================================================================================================
// Raster interrupt forward declarations // Raster interrupt forward declarations
//=========================================================================================================== //===========================================================================================================
@ -412,21 +373,34 @@ begin
RasterIrq(RasterMainPartScroller(), rasterLineMainScroller, @useKernal); RasterIrq(RasterMainPartScroller(), rasterLineMainScroller, @useKernal);
end; end;
//=========================================================================================================== /**
// Main Work state functions * Assembly setup for a character set copy in RAM
//=========================================================================================================== */
procedure CopyCharsetRomToRam(targetHi : byte);
function isMainWorking() : boolean;
var result : boolean;
begin begin
if (mainWorkState = @notWorking) then result := false asm("
else result := true; ldx #$08 ; we loop 8 times (8x255 = 2Kb)
isMainWorking := result; lda #$33 ; make the CPU see the Character Generator ROM...
end; 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); loopc lda ($fb),y ; read byte from vector stored in $fb/$fc
begin sta ($fd),y ; write to the RAM
mainWorkState := s; 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; end;
/** /**
@ -448,14 +422,14 @@ var
begin begin
while (char > 64) do char -= 64; while (char > 64) do char -= 64;
charsetptr += char * 8; tempPtr1 := charsetptr + char * 8;
for k:=0 to 8 do begin for k:=0 to 8 do begin
temp[0] := 0; temp[0] := 0;
temp[1] := 0; temp[1] := 0;
temp[2] := 0; temp[2] := 0;
for i:=0 to 10 do begin for i:=0 to 10 do begin
charTemp := charsetptr[0] & chrBitMask[sprChrBit[i]]; charTemp := tempPtr1[0] & chrBitMask[sprChrBit[i]];
sprOfsTemp := sprOffset[i]; sprOfsTemp := sprOffset[i];
if charTemp then temp[sprOfsTemp] := temp[sprOfsTemp] | sprBitMask[i]; if charTemp then temp[sprOfsTemp] := temp[sprOfsTemp] | sprBitMask[i];
end; end;
@ -465,7 +439,7 @@ begin
sPtr[2] := temp[2]; sPtr[2] := temp[2];
sPtr += 3; sPtr += 3;
end; end;
charsetptr += 1; tempPtr1 += 1;
end; end;
end; end;
@ -629,7 +603,7 @@ begin
begin begin
if (tp[0] = @cmoveto) then if (tp[0] = @cmoveto) then
begin begin
x := tp[1] * 2 + 1; x := tp[1] * 2;
y := tp[2] * 3 - 1; y := tp[2] * 3 - 1;
sp := AddressTable(#mainPartAddressTable, x, y); sp := AddressTable(#mainPartAddressTable, x, y);
tp += 3; tp += 3;
@ -956,7 +930,7 @@ end;
interrupt RasterText(); interrupt RasterText();
begin begin
startIRQ(@useKernal); startIRQ(@useKernal);
UpdateText(); if (currentTime > 50) then UpdateText();
closeIRQ(); closeIRQ();
GoToMainRaster(); GoToMainRaster();
end; end;
@ -1085,7 +1059,6 @@ begin
begin begin
purpleBounceOfs := 0; purpleBounceOfs := 0;
spriteBounceOfs := 0; spriteBounceOfs := 0;
spriteWobbleOfs := 245;
end; end;
if (part = @partMain) then if (part = @partMain) then
begin begin
@ -1128,8 +1101,6 @@ begin
numLinesPtr := #numLines2; numLinesPtr := #numLines2;
hideborderx(1); // avoid choppy scroll
InitMainPart(); InitMainPart();
end; end;
end; end;
@ -1147,19 +1118,53 @@ begin
if (mainState = @mainShowText) then if (mainState = @mainShowText) then
begin 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; end;
if (mainState = @mainPicture) then if (mainState = @mainPicture) then
begin 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;
end; end;
procedure UpdateMainPart(); procedure UpdateMainPart();
begin begin
if (mainState = @mainShowText) then
if (mainState = @mainShowText and not isMainWorking()) then
begin begin
textPlStartX := 0; textPlStartX := 0;
i := lo(textFade); i := lo(textFade);
@ -1172,7 +1177,6 @@ begin
if (mod(textFade, 10) = 0) then inc(plasmaHeight); if (mod(textFade, 10) = 0) then inc(plasmaHeight);
if (plasmaHeight > 9) then plasmaHeight := 9; if (plasmaHeight > 9) then plasmaHeight := 9;
end; end;
if (mainState = @mainFadeToPicture and textFade < 210) then if (mainState = @mainFadeToPicture and textFade < 210) then
begin begin
i := lo(textFade); i := lo(textFade);
@ -1192,18 +1196,7 @@ begin
inc(textFade); inc(textFade);
end; end;
if (mainState = @mainPicture) then 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 begin
// copy picture one row at a time // copy picture one row at a time
if (pictureFade < currentNaamaHeight) then if (pictureFade < currentNaamaHeight) then
@ -1248,7 +1241,6 @@ begin
memcpyfast(#textFadeLumi, 0, tempPtr1, 20); memcpyfast(#textFadeLumi, 0, tempPtr1, 20);
end; end;
end; end;
if (mainState = @mainFadeToText) then if (mainState = @mainFadeToText) then
begin begin
// blank out picture one row at a time // blank out picture one row at a time
@ -1274,9 +1266,9 @@ begin
sprite_color[0]:=0; sprite_color[0]:=0;
sprite_color[1]:=0; sprite_color[1]:=0;
sprite_color[2]:=0; sprite_color[2]:=0;
sprite_color[3]:=0; sprite_color[3]:=$0;
sprite_color[4]:=0; sprite_color[4]:=$0;
sprite_color[5]:=0; sprite_color[5]:=$0;
end; end;
if (mainTime > 50 and nameFade < 150) then if (mainTime > 50 and nameFade < 150) then
@ -1319,7 +1311,6 @@ var lastSpriteWoblOfs : byte;
wobblePause : boolean = false; wobblePause : boolean = false;
wobblePauseTimer : integer = 0; wobblePauseTimer : integer = 0;
cEqualsChangeFlag : boolean = false; cEqualsChangeFlag : boolean = false;
fillPart : byte = 0;
begin begin
if (part >= @partOpenBar) then Call(SIDFILE_1_PLAY); if (part >= @partOpenBar) then Call(SIDFILE_1_PLAY);
@ -1331,11 +1322,6 @@ begin
purpleBarEndRasterLine := purpleBarCenter + purpleBarBounce[purpleBounceOfs] + 1; purpleBarEndRasterLine := purpleBarCenter + purpleBarBounce[purpleBounceOfs] + 1;
RasterIRQ(RasterTextPlasma(), 0, @useKernal); RasterIRQ(RasterTextPlasma(), 0, @useKernal);
inc(purpleBounceOfs); 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; if (purpleBounceOfs >= @purpleBarBounceSize) then currentPartDone := true;
end; end;
@ -1364,32 +1350,22 @@ begin
if (fadeStateCurrent = @fadeStateText) then if (fadeStateCurrent = @fadeStateText) then
begin begin
fadeTemp := textFadeLumi[fadeOfsCurrent]; fadeTemp := textFadeLumi[fadeOfsCurrent];
if (fillPart = 0) then Fill(screen_col_loc, fadeTemp, 255);
begin FillFast(screen_col_loc + 256, fadeTemp, 127);
Fill(screen_col_loc, fadeTemp, 255); Fill(screen_col_loc + 512, fadeTemp, 255);
FillFast(screen_col_loc + 256, fadeTemp, 127); Fill(screen_col_loc + 768, fadeTemp, 232);
fadeOfsCurrent -= 1;
end;
if (fillPart = 1) then
begin
Fill(screen_col_loc + 511, fadeTemp, 255);
Fill(screen_col_loc + 766, fadeTemp, 234);
end;
GoToPurpleBarRasterStart(); GoToPurpleBarRasterStart();
if (fadeOfsCurrent >= @textFadeLumiLast) then if (fadeOfsCurrent >= @textFadeLumiLast) then
begin begin
fadeStateCurrent := @fadeStateAll; fadeStateCurrent := @fadeStateAll;
fadeOfsCurrent := 0; fadeOfsCurrent := 0;
end; end;
inc(fillPart);
if (fillPart = 2) then fillPart := 0;
end; end;
if (fadeStateCurrent = @fadeStateAll) then if (fadeStateCurrent = @fadeStateAll) then
begin begin
fgColBefore := 0; fgColBefore := 0;
Fill(screen_char_loc, KEY_SPACE, 255); Fill(screen_char_loc, KEY_SPACE, 255);
FillFast(screen_char_loc + 255, KEY_SPACE, 127); FillFast(screen_char_loc + 256, KEY_SPACE, 127);
Fill(^$06F8, KEY_SPACE, 240);
GoToPurpleBarRasterStart(); GoToPurpleBarRasterStart();
currentPartDone := true; currentPartDone := true;
screen_fg_col := 0; screen_fg_col := 0;
@ -1469,7 +1445,7 @@ begin
if (mainState = @mainFadeToPicture and mainTime > 200) then GoToNextMainPart(); if (mainState = @mainFadeToPicture and mainTime > 200) then GoToNextMainPart();
if (mainState = @mainFadeToText and mainTime > 100) then GoToNextMainPart(); if (mainState = @mainFadeToText and mainTime > 100) then GoToNextMainPart();
if (mainState = @mainPicture and mainTime > 650) 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(); GoToPurpleBarRasterStart();
end; end;
@ -1502,7 +1478,7 @@ begin
fgColBefore := screen_fg_col; fgColBefore := screen_fg_col;
DisableCIAInterrupts(); DisableCIAInterrupts();
CopyCharSetFromRom(^$c000); CopyCharsetRomToRam($c0);
setmemoryconfig(1,@useKernal,0); setmemoryconfig(1,@useKernal,0);
@ -1522,8 +1498,7 @@ begin
CreateAddressTable(#mainPartAddressTable, $4400, 40, 25); CreateAddressTable(#mainPartAddressTable, $4400, 40, 25);
CreateAddressTable(#colorAddressTable, $d800, 40, 25); CreateAddressTable(#colorAddressTable, $d800, 40, 25);
Fill(^$0518, KEY_SPACE, 240); Fill(^$0568, KEY_SPACE, 200);
Fill(^$0608, KEY_SPACE, 80);
for i := 0 to 256 do fastPlasma[i] := textPlasmaLumi[textPlasmaX[i]]; for i := 0 to 256 do fastPlasma[i] := textPlasmaLumi[textPlasmaX[i]];
@ -1535,53 +1510,5 @@ begin
EnableRasterIRQ(); EnableRasterIRQ();
enableirq(); enableirq();
while (true) do Loop();
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;
end. 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.