Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/coolgirl-multicart/coolgirl-multirom-builder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2020-09-21 00:12:41 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2020-09-21 00:12:41 +0300
commit6d1a15a8ad99725f5e3f9d95b30df53d6a434062 (patch)
tree69c9ad7bbd5761315ec23339cf5facedc300a60f /flash.asm
parent65f7185ad6e99eab403e9111b12e4c34db54136b (diff)
More build info
Diffstat (limited to 'flash.asm')
-rw-r--r--flash.asm16
1 files changed, 10 insertions, 6 deletions
diff --git a/flash.asm b/flash.asm
index 7ecbc49..46e7ce8 100644
--- a/flash.asm
+++ b/flash.asm
@@ -3,13 +3,13 @@
FLASH_TYPE .rs 1 ; flash memory type
flash_detect:
- jsr enable_flash_write
- lda #$F0
- sta $8000
lda #0
sta <FLASH_TYPE
+ jsr enable_flash_write
+ ; enter flash CFI mode
lda #$98
- sta $8AAA
+ sta $80AA
+ ; check for CFI signature
lda $8020
cmp #'Q'
bne .end
@@ -17,11 +17,13 @@ flash_detect:
cmp #'R'
bne .end
lda $8024
- cmp #'I'
+ cmp #'Y'
bne .end
+ ; if signature is ok read flash size
lda $804E
sta <FLASH_TYPE
.end:
+ ; exit CFI mode
lda #$F0
sta $8000
jsr disable_flash_write
@@ -65,7 +67,7 @@ write_flash:
lda #$55
sta $8555 ; write_prg_flash_command(0x0555, 0x55);
lda #$A0
- sta $8AAA ; write_prg_flash_command(0x0AAA, 0xA0);
+ sta $8AAA ; write_prg_flash_command(0x0AAA, 0xA0);
lda [COPY_SOURCE_ADDR], y
sta [COPY_DEST_ADDR], y
.check1:
@@ -103,6 +105,8 @@ read_flash:
rts
flash_set_superbank:
+ lda #0
+ jsr select_prg_bank
ldx LOADER_GAME_SAVE_SUPERBANK
inx
lda #$FF