diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2020-09-27 15:39:57 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2020-09-27 15:39:57 +0300 |
commit | 16b86f0194c4dd4e0a83a741d319c89850e35898 (patch) | |
tree | 7a7293fe6e0d45532dca6122835e099c3ea52e12 /flash.asm | |
parent | e02b7596d64dd9692567dfaccc7eeea1fbdfa958 (diff) |
Banking, 512KB of CHR RAM support
Diffstat (limited to 'flash.asm')
-rw-r--r-- | flash.asm | 22 |
1 files changed, 8 insertions, 14 deletions
@@ -51,7 +51,7 @@ sector_erase: lda $8000 cmp #$FF bne .wait - jsr flash_set_superbank_zero + jsr banking_init rts write_flash: @@ -85,7 +85,7 @@ write_flash: dex bne .loop jsr disable_flash_write - jsr flash_set_superbank_zero + jsr banking_init rts read_flash: @@ -101,29 +101,23 @@ read_flash: inc COPY_DEST_ADDR+1 dex bne .loop - jsr flash_set_superbank_zero + jsr banking_init rts + ; calculate superbank based on save ID flash_set_superbank: lda #0 - jsr select_prg_bank + sta PRG_BANK ldx LOADER_GAME_SAVE_SUPERBANK inx lda #$FF - sta $5000 + sta PRG_SUPERBANK+1 lda #$00 .loop: sec sbc #$02 dex bne .loop - sta $5001 - rts - -flash_set_superbank_zero: - lda #$00 - sta $5000 - sta $5001 - lda #%11111000 - sta $5002 + sta PRG_SUPERBANK + jsr sync_banks rts |