From ede880853ef0b862253787984963bdd84a116fbc Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sun, 20 Sep 2020 20:40:45 +0200 Subject: [PATCH] some code/data size optimizations --- src/aliases/,aliases_ram_lowmem_m65.s | 2 +- src/basic/engine_variables/helper_cmp_fretop.s | 5 ++--- src/kernal/board_m65/mega65_dmagic.s | 12 ++++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/aliases/,aliases_ram_lowmem_m65.s b/src/aliases/,aliases_ram_lowmem_m65.s index 73b55d0f..1db7a619 100644 --- a/src/aliases/,aliases_ram_lowmem_m65.s +++ b/src/aliases/,aliases_ram_lowmem_m65.s @@ -54,7 +54,7 @@ !addr M65_TXTROW_OFF = $592 ; $592-$593 offset to the current text row from the viewport start !addr M65_SCRCOLMAX = $594 ; maximum allowed column ; $595-$5EB -- UNUSED -- - !addr M65_DMAGIC_LIST = $5EF ; $5EF-$5FF reserved for DMAgic list, 17 bytes + !addr M65_DMAGIC_LIST = $5F1 ; $5EF-$5FF reserved for DMAgic list, 15 bytes (modulo bytes are not needed) !addr M65_RS232_INBUF = $600 ; $600-$6FF -- reserved for RS-232 input buffer -- !addr M65_RS232_OUTBUF = $700 ; $700-$7FF -- reserved for RS-232 output buffer -- diff --git a/src/basic/engine_variables/helper_cmp_fretop.s b/src/basic/engine_variables/helper_cmp_fretop.s index 89f9416a..3c98d7c0 100644 --- a/src/basic/engine_variables/helper_cmp_fretop.s +++ b/src/basic/engine_variables/helper_cmp_fretop.s @@ -14,9 +14,8 @@ helper_cmp_fretop: lda DSCPNT+2 cmp FRETOP+1 - beq @1 ; XXX! BNE+RTS would save one byte - rts -@1: + bne @1 lda DSCPNT+1 cmp FRETOP+0 +@1: rts diff --git a/src/kernal/board_m65/mega65_dmagic.s b/src/kernal/board_m65/mega65_dmagic.s index c68ac527..e6339360 100644 --- a/src/kernal/board_m65/mega65_dmagic.s +++ b/src/kernal/board_m65/mega65_dmagic.s @@ -22,10 +22,12 @@ m65_dmagic_oper_fill: ; Set operation type - lda #($03 + $08) ; operation: FILL + allow interrupts + lda #$03 ; operation: FILL sta M65_DMAGIC_LIST+6 - ; XXX! put 0 into M65_DMAJOB_SRC_3 to clear the flags + ; Put this into M65_DMAJOB_SRC_3 too - to make sure flags (4 most significant bits) are cleared + + sta M65_DMAJOB_SRC_3 ; Adapt the addresses, launch the job @@ -42,7 +44,7 @@ m65_dmagic_oper_copy: ; Set operation type - lda #($00 + $08) ; operation: COPY + allow interrupts + lda #$00 ; operation: COPY sta M65_DMAGIC_LIST+6 ; Adapt the addresses, launch the job @@ -135,8 +137,6 @@ m65_dmagic_init: lda #$00 sta M65_DMAGIC_LIST+5 ; <- end of options - ; !XXX modulo is ignored - remove these, shift M65_DMAGIC_LIST up by 2 bytes - sta M65_DMAGIC_LIST+15 ; <- set modulo to 0 - sta M65_DMAGIC_LIST+16 + ; Modulo is never used - thus our list is 15 bytes, not 17 rts