-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbin2vera.inc
85 lines (62 loc) · 2.37 KB
/
bin2vera.inc
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
jmp Bin2vera_end
; ********************************* Macros ************************************
;******************************************************************************
; Sets Address and Bank number for VERA
;******************************************************************************
; Uses: A, X, Y
;******************************************************************************
!macro LOAD_VERA .addr, .bank {
ldy #>.addr
ldx #<.addr
lda #.bank+2
jsr LOAD
}
;******************************************************************************
; Sets lenght of filename and address for SETNAM routine
;******************************************************************************
; Uses: A, X, Y
;******************************************************************************
!macro SET_NAME .len, .addr {
lda #.len
ldx #<.addr
ldy #>.addr
jsr SETNAM
}
Init_VERA:
lda #0 ;Set screen mode 40x30 (320x240)
jsr Screen_set_mode
lda #$01 ;Swap to BG color
jsr CHROUT
lda #$90 ;Black color
jsr CHROUT
lda #$01 ;Swap to FG color
jsr CHROUT
lda #$05 ;White color
jsr CHROUT
lda #PET_CLEAR ;Clear screen
jsr CHROUT
rts
Load_bins:
lda #$06 ; Map height/ width disabled , Bitmap mode 4BPP
sta VERA_L0_CONFIG
stz VERA_L0_MAPBASE ; Map base disabled
lda #$20 ; image start address (($04000 >> 11) = 2) << 2
sta VERA_L0_TILEBASE
stz VERA_L0_HSCROLL_H
stz VERA_L0_HSCROLL_L
stz VERA_L0_VSCROLL_L
stz VERA_L0_VSCROLL_H
lda #1 ; Logical file number
ldx #8 ; Device 8 = SDcard
ldy #0 ; 0=ignore address in bin file
jsr SETLFS
+SET_NAME (Pieces-Board), Board
+LOAD_VERA $4000, 0 ;LOAD to VERA address $04000
lda #%01110001 ; Current field = 0, enable sprite, layers enabled and output mode 1
sta VERA_DC_VIDEO
+SET_NAME (Sprites-Pieces), Pieces
+LOAD_VERA $D600, 0 ;LOAD to VERA address $0D600
+SET_NAME (Binend-Sprites), Sprites
+LOAD_VERA $FC08, 1
rts
Bin2vera_end: