code size optimization for Mega65
This commit is contained in:
1 parent
cec9adce25
commit
b9bf1251da
4 files changed
+48
-63
No files matched your search
@@ -1,63 +0,0 @@
|
|||||||
// #LAYOUT# M65 BASIC_0 #TAKE-HIGH
|
|
||||||
// #LAYOUT# * * #IGNORE
|
|
||||||
|
|
||||||
//
|
|
||||||
// Fetches a single character (depending on version - also skips spaces) - optimized version
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
|
|
||||||
|
|
||||||
|
|
||||||
fetch_character:
|
|
||||||
|
|
||||||
ldy #0
|
|
||||||
|
|
||||||
// Unmap BASIC lower ROM
|
|
||||||
|
|
||||||
lda #$26
|
|
||||||
sta CPU_R6510
|
|
||||||
|
|
||||||
// Retrieve value from under ROMs, advance text pointer
|
|
||||||
|
|
||||||
lda (TXTPTR), y
|
|
||||||
inw TXTPTR
|
|
||||||
|
|
||||||
// FALLTROUGH
|
|
||||||
|
|
||||||
fetch_character_end:
|
|
||||||
|
|
||||||
// Restore memory mapping
|
|
||||||
|
|
||||||
pha
|
|
||||||
lda #$27
|
|
||||||
sta CPU_R6510
|
|
||||||
pla
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
fetch_character_skip_spaces:
|
|
||||||
|
|
||||||
ldy #0
|
|
||||||
|
|
||||||
// Unmap BASIC lower ROM
|
|
||||||
|
|
||||||
lda #$26
|
|
||||||
sta CPU_R6510
|
|
||||||
|
|
||||||
// Retrieve value from under ROMs, advance text pointer
|
|
||||||
!:
|
|
||||||
lda (TXTPTR), y
|
|
||||||
inw TXTPTR
|
|
||||||
|
|
||||||
// Skip space characters
|
|
||||||
|
|
||||||
cmp #$20
|
|
||||||
beq !-
|
|
||||||
|
|
||||||
// Restore memory mapping
|
|
||||||
|
|
||||||
bra fetch_character_end
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
File renamed without changes.
File renamed without changes.
+48
@@ -103,4 +103,52 @@ peek_under_roms_via_FAC1_PLUS_1:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if ROM_LAYOUT_M65
|
||||||
|
|
||||||
|
|
||||||
|
fetch_character:
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
|
||||||
|
// Unmap BASIC lower ROM
|
||||||
|
|
||||||
|
lda #$26
|
||||||
|
sta CPU_R6510
|
||||||
|
|
||||||
|
// Retrieve value from under ROMs, advance text pointer
|
||||||
|
|
||||||
|
lda (TXTPTR), y
|
||||||
|
inw TXTPTR
|
||||||
|
|
||||||
|
// Restore memory mapping
|
||||||
|
|
||||||
|
bra peek_under_roms_finalize
|
||||||
|
|
||||||
|
|
||||||
|
fetch_character_skip_spaces:
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
|
||||||
|
// Unmap BASIC lower ROM
|
||||||
|
|
||||||
|
lda #$26
|
||||||
|
sta CPU_R6510
|
||||||
|
|
||||||
|
// Retrieve value from under ROMs, advance text pointer
|
||||||
|
!:
|
||||||
|
lda (TXTPTR), y
|
||||||
|
inw TXTPTR
|
||||||
|
|
||||||
|
// Skip space characters
|
||||||
|
|
||||||
|
cmp #$20
|
||||||
|
beq !-
|
||||||
|
|
||||||
|
// Restore memory mapping
|
||||||
|
|
||||||
|
bra peek_under_roms_finalize
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user