Page 1 of 1

Here from London - know nothing, but willing to learn

Posted: Tue Jan 24, 2023 8:12 pm
by MostlyHarmless
Hello everyone

I'm MostlyHarmless, from London (England). I'd like to learn how to make programs on the X16 and learn how to program using it.

I've downloaded the r41 Windows binary and gotten that running and managed to get a 10 PRINT "HELLO WORLD" program running.

I then went to download the BASIC for the 'falling snake' game, pasted it in and typed RUN and it all went a bit bonkers and aside from a screen of multi-colour characters, some of which change colour or character, nothing else happened. I waited 10 min, then closed it down and tried again. No luck.

Creating this account to post (sensible?) questions to overcome this blocker, plus to try and learn more about how to learn more about this interesting-looking X16 beast.

Any help, pointers, etc always welcome.

Thanks in advance to you all, and to those behind this project. I hope one day to be able to give back at least a fraction of what it gives me.

Best regards,
MostlyHarmless

Re: Here from London - know nothing, but willing to learn

Posted: Tue Jan 24, 2023 11:57 pm
by kelli217
Some of the programs here and on the Facebook forum were written for a previous version of the emulator, where the system had been designed to have a different layout of video RAM than is currently the case.

If the program is in BASIC and uses the VPOKE and VPEEK commands, then you have to be careful to make sure that any text-oriented VPOKEs are going to memory starting at 1,$B000 and no farther than 1,$EBFF, and that any graphics-oriented VPOKEs are going to memory starting at 0,$0000 and no farther than 1,$2BFF.

Re: Here from London - know nothing, but willing to learn

Posted: Wed Jan 25, 2023 5:29 am
by Daedalus
The problem is likely that the video memory base for the text system was changed to $1b000 like kelli said. Yeah. That'll be it.

Quickie advice? Don't believe anyone that says "Programming is easy." Ok, sure, "Coding" is easy. That's just translating a problem and data that you already know into a syntax (Programming language) that you pretty much know or can easily look up. Think "Hello World" tutorial.

But it spirals out of control quickly from there. "Programming" I.E. "Software Engineering" is about combining all those coded parts into a coherent, integrated whole. And that's the hard part.

Don't fall for quick fixes, instead focus on the basics and always be learning and improving your code. Use low level languages, don't fall for "get rich quick" schemes that promise "Easy programming." You Tube is your friend here... There are LOADS of tutorials and whatnot to be found there.

Using an Assembler like ca65 instead of BASIC may SEEM hard at first, but it's not that bad... and it's a flat learning curve that will massively help you in the future by allowing (Ok, forcing) you to "Think like the CPU" as you solve problems WITH the CPU instead of because of it.

Re: Here from London - know nothing, but willing to learn

Posted: Thu Jan 26, 2023 12:24 am
by Edmond D
Hi,

welcome to the community!

The basic snake game code (viewtopic.php?t=6120) works only on the older R38 release of the emulator. The current version of the emulator you downloaded is R41, which has changes in how the VERA display system works. If you use the older R38 online emulator at https://x16.tmp2k.com and paste the code there it will work.

I'd recommend starting programming in BASIC by looking at the older C64 programming manual https://www.commodore.ca/manuals/c64_us ... uction.pdf, in conjunction with the Basic emulator notes at https://github.com/commanderx16/x16-doc ... 20BASIC.md This approach might yield further questions or need for help, so the community is here to aid you along. The snake game is a little more than I'd suggest anyone take on to start on their first day, unless they had previously extensive coding background.

I'd suggest starting with BASIC coding first. It will help you have easy success in understanding the principals of programming. Consider when home computers came out to the mass market in the early 80s - all the computers ran BASIC at their core and advised most start there. Machine language requires you to do a lot more thinking and mechanics plus know how to do some minimal tasks. A lot can go wrong with trying to self-start with it. If you're inclined then move onward to assembler. I consider it a step up once you're comfortable with BASIC programming.

The community will certainly help you along no matter what path you choose. Happy programming!

Re: Here from London - know nothing, but willing to learn

Posted: Sun Jan 29, 2023 7:19 pm
by MostlyHarmless
Thanks everyone for the warm welcome and the quality responses, each of which I have read more than once and have (hopefully) understood. I've started to take things easy to start with, writing a few BASIC programs (and remembering to 'SAVE' any time I think I have something of value (at least, of value to me - probably not to anyone else though !))

I've managed to get a simple version of 'Paint' working (though lacking 99% of the features of the Microsoft version) - I can doodle around and change the colour, etc.

Next step is to work out how to add menus and such, so I can save and load my 'pictures' / doodles.

It seems, from what I have managed to look at, that BASIC will let me get quite a way, but Assembler would allow me to do much more advanced things. I have a question though - how do I make an assembler program and 'compile' it into the code that will run? Can I do that on the stock x16 download? Do I need any special software, etc?

Also, is there a 'hello world!' equivalent for assembler programming? I've tried googling and reading the forums, but the documentation seems to be a mixture of old, sparse and such.

As always, any help is greatly appreciated!

All the best,
MH

Re: Here from London - know nothing, but willing to learn

Posted: Mon Jan 30, 2023 6:31 am
by JimmyDansbo
Here is a small blog post about my own road from zero assembler knowledge to hello world.
https://techblog.dansbo.dk/?p=191
I am using Acme assembler (just like The 8-Bit Guy) and I still find it easy to use and very productive.

Alternatively you can have a look at SlithyMatt's hello world example on github and youtube.