Commit MetaInfo

Revision9b8f76261d2af7de5b3ee911d758203fea8f2720 (tree)
Time2019-02-10 21:33:50
Authoringlorion <homemicro@ingl...>
Commiteringlorion

Log Message

renamed cartridge load function in ROM to loadcart and support >64K cartridges

Change Summary

Incremental Difference

diff -r e4b0de5aaa6a -r 9b8f76261d2a rom/rom.s
--- a/rom/rom.s Sun Feb 10 04:20:29 2019 -0800
+++ b/rom/rom.s Sun Feb 10 04:33:50 2019 -0800
@@ -122,7 +122,7 @@
122122 sta $a7
123123 lda #$14
124124 sta $a5
125- jsr cart_load
125+ jsr loadcart
126126 cmp #0
127127 beq cart_loaded
128128 dec $c0
@@ -160,7 +160,7 @@
160160 sta $a6
161161 lda $2a0d
162162 sta $a7
163- jsr cart_load
163+ jsr loadcart
164164 cmp #0
165165 bne unloadable_image
166166 lda #$aa
@@ -175,7 +175,7 @@
175175 sta $2003
176176 jmp _end
177177
178-cart_load:
178+loadcart:
179179 ;;; Loads data from a cartridge.
180180 ;;; In:
181181 ;;; $a0..$a3 Location of first byte to load.
@@ -187,46 +187,46 @@
187187 jsr twi_start
188188 jsr cart_set_location
189189 cmp #0
190- bne cart_load_done
190+ bne loadcart_done
191191 jsr twi_restart
192192 cmp #0
193- bne cart_load_done
193+ bne loadcart_done
194194 lda #$a1
195195 jsr twi_send_byte
196196 cmp #0
197- bne cart_load_done
197+ bne loadcart_done
198198 dec $a4
199- bne cart_load_loop
199+ bne loadcart_loop
200200 lda $a5
201- beq cart_load_last
202-cart_load_loop:
201+ beq loadcart_last
202+loadcart_loop:
203203 jsr twi_recv_byte
204204 ldx #0
205205 sta ($a6,x)
206206 jsr twi_ack
207207 inc $a6
208- bne cart_load_skip_msb
208+ bne loadcart_skip_msb
209209 inc $a7
210-cart_load_skip_msb:
210+loadcart_skip_msb:
211211 dec $a4
212- bne cart_load_not_last
212+ bne loadcart_not_last
213213 lda $a5
214- beq cart_load_last
215-cart_load_not_last:
214+ beq loadcart_last
215+loadcart_not_last:
216216 lda #$ff
217217 cmp $a4
218- bne cart_load_loop
218+ bne loadcart_loop
219219 dec $a5
220- jmp cart_load_loop
220+ jmp loadcart_loop
221221
222-cart_load_last:
222+loadcart_last:
223223 jsr twi_recv_byte
224224 ldx #0
225225 sta ($a6,x)
226226 jsr twi_nak
227227 lda #0
228228
229-cart_load_done:
229+loadcart_done:
230230 tax
231231 jsr twi_stop
232232 txa
@@ -241,7 +241,9 @@
241241 ;;; Out:
242242 ;;; a 0 if successful. Any other value indicates an error.
243243 ;;; Clobbers x.
244- lda #$a0
244+ lda $a2
245+ asl
246+ ora #$a0
245247 jsr twi_send_byte
246248 cmp #0
247249 bne cart_set_location_done
Show on old repository browser