Skip to content

Commit 89d7611

Browse files
author
fredrikramsberg
committed
Added option -if to get flicker effect in border while loader loads game.
1 parent 29ec0dd commit 89d7611

File tree

4 files changed

+69
-11
lines changed

4 files changed

+69
-11
lines changed

asm/picloader.asm

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* = $801
33

44
loader_start = $334
5+
interrupt_vector = $314
56

67
!source "constants.asm"
78

@@ -10,6 +11,11 @@ loader_start = $334
1011

1112
!zone picloader {
1213

14+
; Copy background colour
15+
ldx loader_pic_start + 10000
16+
stx $d020
17+
stx $d021
18+
1319
; Copy bitmap data
1420

1521
ldx #0
@@ -46,11 +52,6 @@ loader_start = $334
4652
bcc .copy_screen
4753

4854

49-
; Copy background colour
50-
lda loader_pic_start + 10000
51-
sta $d020
52-
sta $d021
53-
5455
; Show image
5556

5657
; Set bank
@@ -90,6 +91,28 @@ loader_start = $334
9091
sta loader_start,x
9192
dex
9293
bpl -
94+
95+
!ifdef FLICKER {
96+
; Copy background colour to loader code
97+
lda loader_pic_start + 10000
98+
and #15 ; Make sure we don't have any noise in the high nybble
99+
tax
100+
lda .alt_col,x
101+
sta .load_alt_col + 1
102+
103+
; Setup interrupt
104+
sei
105+
lda interrupt_vector
106+
sta .jmp_kernal_interrupt + 1
107+
lda interrupt_vector + 1
108+
sta .jmp_kernal_interrupt + 2
109+
lda #<.interrupt
110+
sta interrupt_vector
111+
lda #>.interrupt
112+
sta interrupt_vector + 1
113+
cli
114+
}
115+
93116
jmp loader_start;
94117

95118
.loader
@@ -107,6 +130,16 @@ loader_start = $334
107130
lda #1
108131
jsr kernal_close
109132

133+
!ifdef FLICKER {
134+
; Clear interrupt
135+
136+
sei
137+
lda .jmp_kernal_interrupt + 1
138+
sta interrupt_vector
139+
lda .jmp_kernal_interrupt + 2
140+
sta interrupt_vector + 1
141+
cli
142+
}
110143
; Hide image and set default graphics bank
111144

112145
; Set graphics mode
@@ -142,15 +175,35 @@ loader_start = $334
142175
lda #3 ; 3 chars are now in keyboard buffer
143176
sta 198
144177

145-
; Set text colour to black
146-
lda #0
178+
; Set text colour to background colour
179+
lda $d021
147180
sta 646
148181

149182
rts
183+
184+
!ifdef FLICKER {
185+
.interrupt
186+
ldx $d020
187+
.load_alt_col
188+
lda #0
189+
sta $d020
190+
nop
191+
nop
192+
stx $d020
193+
.jmp_kernal_interrupt
194+
jmp $ea31
195+
}
196+
150197
.filename
151198
!pet "story"
152199
}
153200
.end_of_loader
201+
202+
!ifdef FLICKER {
203+
.alt_col
204+
!byte 1, 0, 10, 14, 14, 13, 14, 0, 9, 8, 2, 12, 15, 5, 6, 12
205+
}
206+
154207
} ; zone picloader
155208

156209
loader_pic_start

make.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ def read_labels(label_file_name)
656656
def build_loader_file()
657657
necessarysettings = " --cpu 6510 --format cbm"
658658
optionalsettings = ""
659-
optionalsettings += " -DSPLASHWAIT=#{$splash_wait}" if $splash_wait
659+
optionalsettings += " -DFLICKER=1" if $loader_flicker
660660

661661
cmd = "#{$ACME}#{necessarysettings}#{optionalsettings}" +
662662
" -l \"#{$loader_labels_file}\" --outfile \"#{$loader_file}\" picloader.asm"
@@ -1241,7 +1241,8 @@ def build_81(storyname, diskimage_filename, config_data, vmem_data, vmem_content
12411241
def print_usage_and_exit
12421242
puts "Usage: make.rb [-t:target] [-S1|-S2|-D2|-D3|-81|-P]"
12431243
puts " [-p:[n]] [-c <preloadfile>] [-o] [-sp:[n]]"
1244-
puts " [-s] [-x] [-r] [-f <fontfile>] [-cm:[xx]] [-i <imagefile>]"
1244+
puts " [-s] [-x] [-r] [-f <fontfile>] [-cm:[xx]]"
1245+
puts " [-i <imagefile>] [-if <imagefile>]"
12451246
puts " [-rc:[n]=[c],[n]=[c]...] [-dc:[n]:[n]] [-bc:[n]] [-sc:[n]]"
12461247
puts " [-dmdc:[n]:[n]] [-dmbc:[n]] [-dmsc:[n]] [-ss[1-4]:\"text\"]"
12471248
puts " [-sw:[nnn]] [-cb:[n]] [-cc:[n]] [-dmcc:[n]] [-cs:[b|u|l]] "
@@ -1257,6 +1258,7 @@ def print_usage_and_exit
12571258
puts " -f: Embed the specified font with the game. See docs for details."
12581259
puts " -cm: Use the specified character map (sv, da, de, it, es or fr)"
12591260
puts " -i: Add a loader using the specified Koala Painter multicolour image (filesize: 10003 bytes)."
1261+
puts " -if: Like -i but add a flicker effect in the border while loading."
12601262
puts " -rc: Replace the specified Z-code colours with the specified C64 colours. See docs for details."
12611263
puts " -dc/dmdc: Use the specified background and foreground colours. See docs for details."
12621264
puts " -bc/dmbc: Use the specified border colour. 0=same as bg, 1=same as fg. See docs for details."
@@ -1281,6 +1283,7 @@ def print_usage_and_exit
12811283
preloadfile = nil
12821284
$font_filename = nil
12831285
$loader_pic_file = nil
1286+
$loader_flicker = false
12841287
auto_play = false
12851288
optimize = false
12861289
extended_tracks = false
@@ -1363,8 +1366,9 @@ def print_usage_and_exit
13631366
elsif ARGV[i] =~ /^-f$/ then
13641367
await_fontfile = true
13651368
$start_address = 0x1000
1366-
elsif ARGV[i] =~ /^-i$/ then
1369+
elsif ARGV[i] =~ /^-if?$/ then
13671370
await_imagefile = true
1371+
$loader_flicker = ARGV[i] =~ /f$/
13681372
elsif ARGV[i] =~ /^-ss([1-4]):(.*)$/ then
13691373
splashes[$1.to_i - 1] = $2
13701374
elsif ARGV[i] =~ /^-sw:(\d{1,3})$/ then

releasenotes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ New features:
9292
- make.rb support for additional target platforms (currently only -t:c64)
9393
- Added a runtime error for division by zero.
9494
- Option -i to add a loader showing a picture while the game loads.
95+
- Option -if to add a loader showing a picture while the game loads + a slight border flicker while loading.
9596

9697
Optimizations:
9798
- Slight optimization to printchar_buffered.

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7
1+
3.8

0 commit comments

Comments
 (0)