-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrampoline.s
54 lines (43 loc) · 941 Bytes
/
trampoline.s
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
53
54
; This code does some basic system initializations and starts a cartridge
; from bank BOOT_FROM_BANK
* = $ff00
EASYFLASH_BANK = $DE00
EASYFLASH_CONTROL = $DE02
EASYFLASH_LED = $80
EASYFLASH_16K = $07
EASYFLASH_KILL = $04
BOOT_FROM_BANK = $08
start:
; === the reset vector points to here ===
sei
ldx #$ff
txs
cld
lda #$37
sta $01
lda #$2f
sta $00
; enable VIC (e.g. RAM refresh)
lda #8
sta $d016
; write to RAM to make sure it starts up correctly (=> RAM datasheets)
wait:
sta $0100, x
dex
bne wait
; x is 0 now
copy:
lda ramcode, x
sta $0400, x
inx
bne copy
jmp $0400
ramcode:
!pseudopc 0x0400 {
lda #BOOT_FROM_BANK
sta EASYFLASH_BANK
jmp ($fffc)
}
!fill $0100 - (* - start) - 4, $ff
!word start
!word 0xffff