@henols/c64-re-tools 2.5.0 → 2.5.1-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,8 @@
4
4
  ; The loader includes this file in its copier, with the interrupts off. The
5
5
  ; code uses no stack and writes only the I/O area, the colour RAM and its own
6
6
  ; bytes: the copies wrote pages 0-3 of the entry state already.
7
- ; Set START_SCREEN = 0 in config.asm to start the program at once.
7
+ ; Set START_SCREEN = 0 in config.asm to start the program at once. The start
8
+ ; screen is part of the clean build only: a release and LEFTOVERS = 1 have none.
8
9
  ; loader.asm sets these values from the start screen of the knowledge:
9
10
  ; c64_source_ss_d011, c64_source_ss_d016, c64_source_ss_d018: the VIC-II mode
10
11
  ; c64_source_ss_bank: the VIC bank, as bits 0-1 of $dd00
@@ -12,10 +13,16 @@
12
13
  ; c64_source_ss_colour_mode: 0 no colour RAM, 1 one colour, 2 a copy of 1000 bytes
13
14
  ; c64_source_ss_colour: the one colour (mode 1)
14
15
  ; c64_source_ss_colours: the address of the 1000 bytes (mode 2)
16
+ ; The show stage of a start screen from a captured stage can also set:
17
+ ; c64_source_ss_call: a routine of the stage, for example the start of the
18
+ ; loading tune. The code calls it with the KERNAL in and the interrupts on,
19
+ ; after the screen shows and before the wait. The interrupts stay on in the
20
+ ; wait, so each read of the keyboard and the joysticks is done with SEI.
15
21
 
16
22
  !ifndef START_SCREEN { START_SCREEN = 1 }
23
+ !ifndef LEFTOVERS { LEFTOVERS = 0 }
17
24
 
18
- lda #START_SCREEN
25
+ lda #START_SCREEN & (1 - LEFTOVERS)
19
26
  bne .on
20
27
  jmp .end
21
28
  .port !byte 0
@@ -78,12 +85,23 @@
78
85
  }
79
86
  lda #c64_source_ss_d011
80
87
  sta $d011
88
+ !ifdef c64_source_ss_call {
89
+ lda #$37
90
+ sta $01
91
+ cli
92
+ jsr c64_source_ss_call
93
+ }
81
94
 
82
95
  ; Y is the phase: 0 waits until nothing is pressed, for example the
83
96
  ; RETURN of RUN; 1 waits for a press; 2 waits until it is released.
84
97
  loader_start_screen_wait
85
98
  ldy #0
86
- .poll lda #$ff
99
+ .poll
100
+ !ifdef c64_source_ss_call {
101
+ ; An interrupt of the stage must not write $dc00 between a write and a read.
102
+ sei
103
+ }
104
+ lda #$ff
87
105
  sta $dc00
88
106
  ; No keyboard row is driven: $dc01 gives joystick 1 alone.
89
107
  lda $dc01
@@ -107,12 +125,19 @@ loader_start_screen_wait
107
125
  lda $dc01
108
126
  and .joy
109
127
  bne .down
128
+ !ifdef c64_source_ss_call {
129
+ cli
130
+ }
110
131
  tya
111
132
  beq .settle
112
133
  cmp #2
113
134
  beq loader_start_screen_continue
114
135
  bne .poll
115
- .down cpy #1
136
+ .down
137
+ !ifdef c64_source_ss_call {
138
+ cli
139
+ }
140
+ cpy #1
116
141
  bne .poll
117
142
  iny
118
143
  bne .poll
@@ -130,6 +155,9 @@ loader_start_screen_wait
130
155
  bne .poll
131
156
 
132
157
  loader_start_screen_continue
158
+ !ifdef c64_source_ss_call {
159
+ sei
160
+ }
133
161
  lda .port
134
162
  sta $dc00
135
163
  lda .ddra