Learning to make spritesI was looking through the contents of the cassette that came with the ... Read More!
Amstrad 3.5" Floppy drive - DSK to DiscSo you've got the floppy drive all powered and plugged in, but got no Amstrad CPC software on 3.5" d... Read More!
Amstrad Controller PCB'sIt's been a while since I last posted, yet again. I've been paying a fair bit of attention to the we... Read More!
Connecting a 3.5" floppy drive to an Amstrad 464 without modifying the drive or DDI-1Quite some time ago I bought a DDI-1 interface to use with my amstrad 464's. Just the interface with... Read More!
Amstrad 3.5" Floppy drive - Making a new ribbon cable, case and switchesSo if you've followed the previous blog posts about making a PC 3.5" floppy drive work with your Ams... Read More!
Making BASIC more complicated
Created on: 18-10-2019 By Gee
My previous post was about me learning how to make a program in BASIC, and it worked!
There was a little bit of complicated math (for my brain), but it wasn't exactly an awe inspiring program. So I decided I would make it a bit better. Make it so that you can use it over and over just by using the arrow keys to select your day, month, year and it would automatically update the day of the week on the fly.
So that's exactly what I've done. So technically I've actually made my 1st ever real Amstrad program. wooo!
Anyway, back to the point.
I started by making my layout, placing the "Day Month Year" labels where I wanted them and then then placing the arrows above and below them. Then I put some placeholder date text in to see how it all looked.
Once that was done it was just a case of changing the numbers into variables and making the arrows change whenever the correlating buttons were pressed.
The difficult part was, after I had the program working, cutting down the code as I had made it quite bloated and used some duplicate and triplicate code where I could have used a bunch of variables instead. It was easier at the time to just make the duplicate code.
However, once it WAS running right, I added a couple of functions such as pressing R for a random date and pressing E to exit the program. I also cut the code down quite a but, going from 171 lines of BASIC to 109 or there abouts. I can't remember exactly now.
The duplicated code got cut out and made into Variables. I also cut down a couple of other bits that didn't need to be there. So the code runs a little quicker now.
Next thing for me to do is to remake the whole program, this time in z80 assembly language. I'll then be able to port it to the spectrum too if I really wanted to by editing the code ever so slightly. AND if I'm clever about the way I write the code, I'll be able to make the assembler do the work of choosing which system it's compiling for.
So, keep your eyes pealed for a much faster version of the program coming to this website.
I just need to find the newer version of the program I made in BASIC so I can share it on here too..