I owned an original ViC20 and C64 in the 80s, but never really dealt with Basic at the time. I would like to get into programming. Have "a little" C++ and Java experience. As a practice project, I thought about a Pen&Paper D&D calculator that simulates simple battles between players and monsters using simulated dice results. But even with designing a simple interface for entering character stats, I don't even know where to start.
Is there a documentation or other assistance to get along with something like that. Positioning text and cursor input on the screen is a bit overwhelming for me.
Can someone give me a little help with this?
Beginners looking for support
Re: Beginners looking for support
Are you going to do this in BASIC, C, or assembly language?
The methods of doing things like positioning the cursor are a little different in each language:
BASIC has the LOCATE command:
LOCATE with just the ROW keeps the same column. Consider this:
The output looks like this:
C:
Using a C compiler, you could use the function gotoxy(), located in the conio library. There are also gotox() and gotoy() variants.
Assembly:
In assembly, you need to call the PLOT routine. Much like LOCATE, the .X and .Y are reversed, so you'd do something like
PLOT = $FFF0 ; sets an assembler variable
LDX row
LDY col
JSR PLOT
(check out https://www.pagetable.com/c64ref/kernal/ for a great listing of all the KERNAL routines. We don't have them all on the X16, but PLOT is there.)
Personally, I'd start with BASIC, since it's the easiest way to get your feet wet, and it doesn't require installing any extra tools. We're always happy to help here, or you can hit us up on the Discord (the link is on the commanderx16.com home page.)
The methods of doing things like positioning the cursor are a little different in each language:
BASIC has the LOCATE command:
Code: Select all
LOCATE ROW, COL
Code: Select all
10 LOCATE 5,5
20 PRINT "HELLO";
30 LOCATE 6
40 PRINT "WORLD"
HELLO WORLD READY. █
C:
Using a C compiler, you could use the function gotoxy(), located in the conio library. There are also gotox() and gotoy() variants.
Assembly:
In assembly, you need to call the PLOT routine. Much like LOCATE, the .X and .Y are reversed, so you'd do something like
PLOT = $FFF0 ; sets an assembler variable
LDX row
LDY col
JSR PLOT
(check out https://www.pagetable.com/c64ref/kernal/ for a great listing of all the KERNAL routines. We don't have them all on the X16, but PLOT is there.)
Personally, I'd start with BASIC, since it's the easiest way to get your feet wet, and it doesn't require installing any extra tools. We're always happy to help here, or you can hit us up on the Discord (the link is on the commanderx16.com home page.)
Re: Beginners looking for support
Similar boat, different language choices over the years. What I am doing about it is going back to being like a child. of the 80s and doing what everyone did back then, copy in BASIC program after BASIC program until enought sneaks in through osmosis that I get it. I intend to do the same for ASM, but I'm not there yet. I am working on real C64c, but at some point I'll be on to other cool things like the x16.
There is an immense number of books with programs ready for typing here, https://archive.org/details/commodore_c64_books. I am sure others can recommend other "listings" copy in, there is no shortage of example programs out there to cut your teeth on.
There is this cool "CHEXSUM" program I found in https://archive.org/details/commodore-6 ... k/mode/2up that helps with verifying you copied in the correct stuff, per line (for this book only) - though this program itself demonstrates some interesting concepts.
There is an immense number of books with programs ready for typing here, https://archive.org/details/commodore_c64_books. I am sure others can recommend other "listings" copy in, there is no shortage of example programs out there to cut your teeth on.
There is this cool "CHEXSUM" program I found in https://archive.org/details/commodore-6 ... k/mode/2up that helps with verifying you copied in the correct stuff, per line (for this book only) - though this program itself demonstrates some interesting concepts.
Re: Beginners looking for support
Try starting with X16 docs: https://github.com/X16Community/x16-docs
Here is a BASIC section: https://github.com/X16Community/x16-doc ... 20BASIC.md
Here is a BASIC section: https://github.com/X16Community/x16-doc ... 20BASIC.md
Re: Beginners looking for support
Oh wow, c64c46c, that's exactly what I've been looking for..
Got a little overwhelmed with the "Programming the 65816, etc.." mainly because I couldn't find a single emulator/monitor combo that worked for the 65816, not without spending a bunch of cash and not knowing if it would even work.
I think I'll just dive into that huge list of C64 stuff and see how that goes..
Thanks!!
Got a little overwhelmed with the "Programming the 65816, etc.." mainly because I couldn't find a single emulator/monitor combo that worked for the 65816, not without spending a bunch of cash and not knowing if it would even work.
I think I'll just dive into that huge list of C64 stuff and see how that goes..
Thanks!!
Re: Beginners looking for support
Hello EbonHawk,
the 65816 is not used in this project. Instead, a wicked fast version of the 6502 is used. Actually much faster than any 6502 System of the 80's. It was explained in the latest Video (in the end there is a Q&A section called "Why not a Z80?"):
Anyway you can use all the principles and most Kernal routines just like on a C64 - as many have pointed out here already.
You could also try a "more comfortable" basic crosscompiler. For example you can use your favorite text editor on Win/Mac - and you don't need to worry about line numbers.
I'm sure there are probably more of them, but I just got started with https://xc-basic.net/doku.php?id=v3:com ... 16_support
the 65816 is not used in this project. Instead, a wicked fast version of the 6502 is used. Actually much faster than any 6502 System of the 80's. It was explained in the latest Video (in the end there is a Q&A section called "Why not a Z80?"):
Anyway you can use all the principles and most Kernal routines just like on a C64 - as many have pointed out here already.
You could also try a "more comfortable" basic crosscompiler. For example you can use your favorite text editor on Win/Mac - and you don't need to worry about line numbers.
I'm sure there are probably more of them, but I just got started with https://xc-basic.net/doku.php?id=v3:com ... 16_support