-
Notifications
You must be signed in to change notification settings - Fork 31
Commodore 128 Port #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commodore 128 Port #305
Conversation
In preparation to support other systems such as the C128, refactor the Makefile to be more dynamic. All .fs files in forth_src/ will now automatically get pulled into the disk image. Sources in the forth_src/c64/ (though nothing is there yet) will get pulled into the C64 disk image only. The refactored makefile also allows for more parallelism with `make -j` and avoids redundant ASCII-PETSCII conversions.
In preparation for C128 port
Support running in native mode on C128. `gfx` and `v` working with 40 column display. Changed all raw addresses used in asm code into labels that can be redefined for different targets as necessary.
Thank you! How exciting! I will have a careful look in time and try to provide meaningful feedback. Looking forward! |
Take your time - I realise there's a lot of changes in there. I'm new to Forth, so please forgive any novice mistakes! |
Per Greg King's comment on issue jkotlinski#95, this is not a bug, and CLRCHN should be used on both C64 and C128.
$ff48 of 64 endof | ||
$ff17 of 128 endof | ||
abort" cannot identify platform" | ||
endcase ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems wasteful to do this check in runtime, both in terms of memory and CPU cycles. Could it be better to introduce a constant that is set from assembly TARGET?
$d7 c@ if | ||
abort" v only supports 40-column mode. | ||
press esc-x to switch modes." | ||
then ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i suppose if
/then
should be removed.
\ Definitions for kernal vars and routines | ||
|
||
\ TBLX - cursor line number | ||
$d6 constant k-tblx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is "k" for "kernal"? i think "tblx" would be enough.
It's a little disturbing to have a file for a single constant, since compile times increase with the number of files. Could it be solved in some other way?
Maybe this is a big enough change to warrant mention in README.md? |
Hows the progress on this PR? This is very interesting indeed. |
I forgot about this PR, sorry about that. |
Since time passed, there now is a lot of conflicts. I will continue the work of merging this in #478 |
After the discussion in #95, I reorganized the Makefile so that conditional compilation (
[if]
-[else]
-[then]
) was no longer needed.Now, everything in
forth_src/
is common to both systems, andforth_src/c64
andforth_src/c128
contain code that is specific to those machines.v
andgfx
now includevcore
andgfxcore
, which contain their platform-specific parts.There are also a couple of new source files:
kernal
is intended to define platform-specific constants for kernal variables and subroutines; right now this is onlyk-tblx
, the TBLX zeropage location that indicates the current cursor line (used bymore
), but a lot of constants inv
could be factored into it for clarity.far
is only for the C128, and defines 'far' versions of!
,@
,c!
andc@
that can operate on memory in other banks.sys
on the C128 also defines asysfar
word that works likesys
but can call routines in other banks.platform
detects the type of system it is being compiled on, and defines aplatform
constant as either 64 or 128, depending on the system - with conditional compilation gone, there was no need for thenative-c128
compile-time constant, but I thought that platform detection might still be useful to somebody.I have added a new section to the manual describing the 128 port and 128-specific words. I wasn't quite sure where in the table of contents it should go; feel free to move it as needed.