jkotlinski / durexforth

Modern C64 Forth
Other
233 stars 28 forks source link

Factor Kernal swapping to SYS #288

Closed burnsauce closed 2 years ago

burnsauce commented 4 years ago

rom-kernal of gfx and kernal-in of v are similar, as are their counterparts.

It seems like these words should be factored into sys or somewhere.

Whammo commented 2 years ago

Perhaps this is a non-issue. I can do like:

code bank
w       sta,
$01     lda,
$f8     and,#
w       ora,
$01     sta,
;code

: set-bank ( u -- )
ar c! ' bank sys ;

And v

\ ram + io + kernal rom
code rom-kernal
$06 lda,# ' bank jsr, ;code
\ ram + io + ram
code ram-kernal
$05 lda,# ' bank jsr, ;code

And gfx

code kernal-in
6 lda,# ' bank jsr, cli, ;code
code kernal-out
sei, 5 lda,# ' bank jsr, ;code

But it adds a couple bytes and it not something that should be done lightly.

burnsauce commented 2 years ago

I think this issue has been resolved: it's not worth the savings to factor these commonly.