-
Notifications
You must be signed in to change notification settings - Fork 0
/
twil_putScreenXY_bank_signature_bkp.s
126 lines (94 loc) · 2.42 KB
/
twil_putScreenXY_bank_signature_bkp.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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
;.if .defined(TWIL_INC_LOADED)
.include "include/twil.inc"
;.endif
;.struct twil_bank_struct
;id_bank .res 1
;signature_str .res 1
;pos_x .res 1
;pos_y .res 1
;.endstruct
TWIL_READ_BYTE_FROM_OVERLAY_RAM := $04C7
; AY contains struct ptr
.proc twil_putScreenXY_bank_signature
;
sta RES
sty RES+1
sei
lda TWILIGHTE_BANKING_REGISTER
sta save_twilighte_banking_register
; switch to ram
lda TWILIGHTE_REGISTER
sta save_twilighte_register
ldy #twil_bank_struct::id_bank
lda (RES),y
jsr _twil_get_registers_from_id_bank
; X set
; A register bank
sta TWILIGHTE_REGISTER
stx TWILIGHTE_BANKING_REGISTER
jsr twil_get_bank_empty ; Is it an empty ROM ?
cmp #$00
bne @not_empty
; then displays empty
jmp @restore
@not_empty:
;ora #%00100000
;sta $342
;jsr displays_banking
;lda $342
;and #%11011111
;sta $342
;jsr displays_banking
@restore:
lda save_twilighte_register
sta TWILIGHTE_REGISTER
lda save_twilighte_banking_register
sta TWILIGHTE_BANKING_REGISTER
cli
rts
save_twilighte_register:
.res 1
save_twilighte_banking_register:
.res 1
.endproc
.proc twil_get_bank_empty
lda #<$FFF0
sta twil_get_bank_empty_ptr1
lda #>$FFF0
sta twil_get_bank_empty_ptr1+1
ldy #$00
ldx #$00 ; Read mode
jsr TWIL_READ_BYTE_FROM_OVERLAY_RAM ; get low
rts
.endproc
.proc twil_get_bank_is_empty
; A id of the bank
sei
pha
lda TWILIGHTE_BANKING_REGISTER
sta save_twilighte_banking_register
; switch to ram
lda TWILIGHTE_REGISTER
sta save_twilighte_register
pla
jsr _twil_get_registers_from_id_bank
; X set
; A register bank
sta TWILIGHTE_REGISTER
stx TWILIGHTE_BANKING_REGISTER
lda #<$FFF0
sta twil_get_bank_empty_ptr1
lda #>$FFF0
sta twil_get_bank_empty_ptr1+1
ldy #$00
ldx #$00 ; Read mode
jsr TWIL_READ_BYTE_FROM_OVERLAY_RAM ; get low
pha
lda save_twilighte_register
sta TWILIGHTE_REGISTER
lda save_twilighte_banking_register
sta TWILIGHTE_BANKING_REGISTER
pla
cli
rts
.endproc