Skip to content
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

Add target for C64 :) #99

Open
EricCarrGH opened this issue Dec 3, 2024 · 2 comments
Open

Add target for C64 :) #99

EricCarrGH opened this issue Dec 3, 2024 · 2 comments

Comments

@EricCarrGH
Copy link

I wonder, since it is using ca65 asm, how difficult it would be to add a target/cfg file for C64, and have the basic integer-only interpreter working, and run a proof-of-concept program (control statements, vars, peek/poke).

I may try this.

@dmsc are there any major obstacles you can think of that make this difficult?

@dmsc
Copy link
Owner

dmsc commented Dec 3, 2024

Hi!

A basic program should not be difficult, after rewriting the basic I/O support.

But, there is one roadblock: currently FastBasic needs the address 0 to be filled with the value 0 - this is used to detect nul strings. The interpreter initializes pointers to 0, this means that a new declared string will read the address 0 to get the string length. This is a simple optimization, but ensures that you can do:

   DIM A$(10)
   ? A$(1),A$(2)

This will print two empty strings. If the address 0 has any other value, the above will print some random data.

I don't have much knowledge of C64, you could try porting some basic code and see if it works.

Have Fun!

@EricCarrGH
Copy link
Author

Good to know, thank you. ZP address $0 and $1 are IO port registers for the 6510 (6502 variant) in the C64. Right now, the program could set $0 to 0 at start for a simple POC, and move the C64 screen memory (defaults to $400-$7E7) or change LBUFF, etc.

I'll do some exploring/testing when I get some time and post any updates.

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

No branches or pull requests

2 participants