-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupet.asm
54 lines (40 loc) · 843 Bytes
/
upet.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
; PET/CBM EDIT ROM - Micro-PET Extensions (C)2021 Andre Fachat
; ================
; Editor-ROM extensions for the Ultra-PET/Micro-PET:
;
; Currently only a hook into the Soft Reboot is used, to get to the Micro-PET
; Boot screen, where the actual type of PET can be selected.
;
; Some future extensions could be graphics options menu, or a speed selector
!IF KEYRESET=1 {
SPEED=$e803
LOW32K=$e802
MEMMAP=$e801
VCTRL=$e800
SPI=$e808
SPIDATA=$e809
FLASH=$01
RebootUPet
sei
lda #0
sta SPEED ; 1MHz to make sure not to overrun SPI
sta MEMMAP ; all RAM (writeable)
sta VCTRL
sta LOW32K
lda #FLASH
sta SPI
lda #3 ; SPI Flash READ
sta SPIDATA
lda #0
sta SPIDATA
sta SPIDATA
sta SPIDATA
lda SPIDATA ; trigger first byte
ldx #0
loop lda SPIDATA
sta $ff00,x
inx
bne loop
stx SPI
JMP ($FFFC)
}