@@ -15,36 +15,61 @@ org 0x11c5
1515 defs 1 , 255 ; unused locations (common)
1616
1717.ifdef ROM0
18-
1918; THE 'COLD START' ROUTINE
20- org 0x11c6
21- ;org 0x3cac
2219cold_start:
23- ld a , 62 ; 512x192 mode, white on black
24- out (scld) , a ; DOCK bank, interrupts on
25- xor a ; ensure no sideways RAM is
26- out (mmu) , a ; paged in on Chloe 280SE
27- ld b , 7 ; bank count
28-
29- org 0x11cf
20+ xor a ; LD A, 0
21+ out (ula) , a ; BORDER 0
22+ out (mmu) , a ; ensure no sideways RAM is paged in
23+ ld a , % 00001000 ; ROM 0, VRAM 1; RAM 0
24+ ld bc , paging ; select paging
25+ out (c) , a ; set it
26+ ld hl , font - 256 ; offest to ASCII character zero
27+ ld (chars) , hl ; store it in chars
28+ ld iy , err_nr ; err-nr to IY
29+ ld bc , 21 ; byte count
30+ ld de , init_chan ; destination
31+ ld hl , channels ; source
32+ ld (chans) , hl ; set system variable
33+ ex de , hl ; swap pointers
34+ ldir ; copy initial channel table
35+ ld c , 14 ; byte count
36+ ld de , strms ; destination
37+ ld hl , init_strm ; source
38+ ldir ; copy initial streams table
39+ ld (iy + _df_sz) , 2 ; set lower display size
40+ call cls ; clear screen
41+ xor a ; prepare for printing
42+ ld de , copyright - 1 ; copyright message
43+ call po_msg ; print it
44+ ld a , 62 ; 512x192 mode, white on black
45+ out (scld) , a ; DOCK bank, interrupts on
46+ ld b , 6 ; bank count
47+
3048cold_start_1:
31- ld a , b ; store count in A
49+ ld a , b ; count to A
50+ or % 00001000 ; set VRAM 1
3251 ld bc , paging ; select paging
3352 out (c) , a ; set page
34- ld hl , 49152 ; first byte of top 16K
35- ld de , 49153 ; second byte of top 16K
36- ld bc , 16383 ; 16K - 1
37- ld (hl) , 0 ; zero first byte
38- ldir ; cold_start_1 bank
39- ld b , a ; restore count
40- djnz cold_start_1 ; loop until banks 1 to 7 cleared
41- ; ROM 1 will clear bank 0
42- jp mode_switch ; switch immediately to graphics mode
43-
44- org 0x11e8
45- defs 184 , 255 ; unused locations (ROM 0)
53+ ld hl , 49152 ; first byte of top 16K
54+ ld de , 49153 ; second byte of top 16K
55+ ld bc , 16383 ; 16K - 1
56+ ld (hl) , 0 ; zero first byte
57+ ldir ; clear bank
58+ and % 00000111 ; get real count
59+ ld b , a ; restore count to B
60+ djnz cold_start_1 ; loop until banks 1 to 6 cleared
61+ im 1 ; set interrupt
62+ ld b , 144 ; pause approximately 5 seconds in total
63+ ei ; enable interrupts
64+
65+ cold_start_2:
66+ halt ; pause
67+ djnz cold_start_2 ;
68+ di ; switch off interrupts again
69+ ld e , % 00011000 ; ROM 1, VRAM 1, RAM 0
70+ jp mode_switch_2 ; switch immediately to ROM 1
4671.endif
47- . ifdef ROM1
72+ ifdef ROM1
4873
4974; THE 'TEST 16K' ROUTINE
5075org 0x11c6
@@ -364,7 +389,9 @@ org 0x13dd
364389.ifdef ROM1
365390
366391org 0x13da
367- defs 3 , 255 ; unused locations (ROM 1)
392+ new_128:
393+ xor a ; retain graphics mode
394+ jr new_128_1 ; immediate jump
368395
369396org 0x13dd
370397new_48:
@@ -385,8 +412,8 @@ new_128:
385412.ifdef ROM1
386413
387414org 0x13e6
388- new_128 :
389- call mode_switch ; ensure ROM 0
415+ new_128_1 :
416+ call mode_switch_1 ; ensure ROM 0
390417
391418org 0x13e9
392419 defs 1 , 255 ; unused locations (ROM 1)
0 commit comments