more work on CP/M memory banking

This commit is contained in:
FeralChild64 committed 2020-12-31 23:07:33 +01:00
1 parent d71ce24357
commit 05c68cd79d
4 files changed
+105 -26

No files matched your search

+32 -7
View File
@@ -12,36 +12,61 @@ z80_table_gen:
;
; Generating: z80_atable_mi_bank0, z80_atable_hi_bank0
; Dependencies: NONE
; Destroys: NONE
;
ldx #$00
@loop_atable_bank0:
cpx #$E0
bcs @common_addr
cpx #$C0
bcs @addr_common
; Memory area $0000-$DFFF - maps to $02000-$0FFFF - 56KB
; Memory area $0000-$BFFF - maps somewhere to $0xxxx range - 48KB total
lda #$04
lda #$00
sta z80_atable_hi_bank0, x
txa
cmp #$60
bcc @addr_lo
@addr_hi:
; Memory area $6000-$BFFF - maps to $0C000 - $0FFFF - 24 KB
clc
adc #$40
@addr_lo:
; Memory area $0000-$5FFF - maps to $02000 - $07FFF - 24 KB
adc #$20
sta z80_atable_mi_bank0, x
@common_addr:
bra @loop_atable_next
@addr_common:
; Memory area $E000-$FFFF - maps to $4E000-$4FFFF - 8KB
; Memory area $C000-$FFFF - maps to $5C000-$5FFFF - 16KB
lda #$04
lda #$05
sta z80_atable_hi_bank0, x
txa
sta z80_atable_mi_bank0, x
@loop_atable_next:
inx
bne @loop_atable_bank0
;
; Generating: XXX
; Dependencies: NONE
; Destroys: NONE
;
; XXX add more tables here
;