Skip to content

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

Closed
wants to merge 8 commits into from
Closed

Conversation

rhalkyard
Copy link
Contributor

@rhalkyard rhalkyard commented Dec 15, 2020

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, and forth_src/c64 and forth_src/c128 contain code that is specific to those machines. v and gfx now include vcore and gfxcore, 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 only k-tblx, the TBLX zeropage location that indicates the current cursor line (used by more), but a lot of constants in v could be factored into it for clarity.

  • far is only for the C128, and defines 'far' versions of !, @, c! and c@ that can operate on memory in other banks. sys on the C128 also defines a sysfar word that works like sys but can call routines in other banks.

  • platform detects the type of system it is being compiled on, and defines a platform constant as either 64 or 128, depending on the system - with conditional compilation gone, there was no need for the native-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.

rhalkyard and others added 6 commits December 15, 2020 09:25
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.
@jkotlinski
Copy link
Owner

Thank you! How exciting! I will have a careful look in time and try to provide meaningful feedback. Looking forward!

@rhalkyard
Copy link
Contributor Author

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.
@rhalkyard rhalkyard mentioned this pull request Dec 17, 2020
$ff48 of 64 endof
$ff17 of 128 endof
abort" cannot identify platform"
endcase ;
Copy link
Owner

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 ;
Copy link
Owner

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
Copy link
Owner

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?

@jkotlinski
Copy link
Owner

Maybe this is a big enough change to warrant mention in README.md?

@xlar54
Copy link

xlar54 commented Aug 13, 2021

Hows the progress on this PR? This is very interesting indeed.

@jkotlinski
Copy link
Owner

I forgot about this PR, sorry about that.

@jkotlinski
Copy link
Owner

Since time passed, there now is a lot of conflicts. I will continue the work of merging this in #478

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants