123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|457|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Retro Coding -> I Never Had a C64

Page : 1 2 Next
Prev
Sat, 29 May 2021, 14:57
Jayenkai

I Never Had a C64


I owned a ZX Spectrum and an Amstrad CPC growing up. I've used C64 emulators for playing games, but never really dabbled with coding on one.

Until this past couple of weeks, I'd not delved into the intricacies of the ascii characters, the inks, the graphics modes and more.

And, I have to say.

WHAT THE HELL WERE THEY ON!?!?!!
Oh my GOD!!!

The resolutions seem to be insanely arbitrary, having a myriad of different colour/block settings in each one.
The ASCII chart is off the frickin' scale, with the default chr set not even having lower case letters?! What!?!?!
How did you C64 owners ever cope with this?!
This is absolute madness!!!

The Amstrad had 3 modes, low-res with 16 colours, normal with 4 colours, hires with 2 colours.
Nothing more specific than that.
Pixels and characters mixed nicely, no colour clashing, no need to stick to x-colours per block, and you pick and choose the colours from the same palette no matter what the mode.
The chr chart was a complete 256 characters (with <32 being command characters, and not crazy shit like "Character 147 clears the screen"....
WHAT?!!

My head's literally exploded 50 times, in the past few weeks, as I've read up on this stuff, and I can't quite grasp how utterly bizarre it all is.

-=-=-

* disclaimer : I do own a C64. It's Krylar's. It's sitting in it's box because I don't want to blow it up, since I don't have a US Step-down convertor. I've had it running once or twice on a borrowed step-down convertor, but never considered it important enough to buy one of my own to use it full-time, as it were.. Perhaps now is a good time to do that..

-=-=-
''Load, Next List!''
Sat, 29 May 2021, 15:34
rockford
My best mate had a C64 when growing up and it had some awesome games that the Amstrad didn't (at the time or ever) - eg Uridium, ParaDroid, Spy Vs Spy, Gribbly's Day Out and BoulderDash to name just a small selection).

We also did a few Type-Ins from the magazines of the time (Your Computer, PCW, C&VG etc. etc.) They were fecking mental. Trying to find and use the character codes on the keys took forever and the BASIC language seemed very alien. Whole lines appeared to be just pure gobbledeegook. But it was still fun. Just, not as much fun as coding the CPC.

The goode olde days, eh?
Sun, 30 May 2021, 03:13
Dan
wpguru.co.uk/2014/06/how-to-switch-between-upperlower-case-and-petscii-fonts-on-a-c64/


The c64 has some limits (e.g. not easy hires graphics mode and sound (in basic)), but still ... the is great

(especially if you have some kind of fast loader cartridge or of course the Action replay cartridge)

Ah yes, the type-ins. I have learned to use the keyboard by typing the progs and games from the magazines.
Mon, 31 May 2021, 05:51
spinal
From memory, you can use upper and lower case letters together without issue, but 'control characters' must be used, if you print "" something, anything that would usually be used to change a character, eg, hold shift to change case, will result in the control character appearing before the letter. I might be wrong there, but it does the same for changing colours, you would 'print""' the colour character before the text, ctrl+1 of C=+4 etc.

-=-=-
Check out my excellent homepage!
Mon, 31 May 2021, 07:42
rockford
Yep, totally fecking bonkers!
Mon, 31 May 2021, 08:03
Dan
Yeah, it was the same for the color and cursor movement.
With them you can write in 2~3~4 rows with a single print command.

The control chars worked even in/as filenames, resulting in a different color or cleared screen.

www.c64-wiki.com/wiki/control_character

But, for someone who has programmed a bit on c64 and amiga, learning that clearing the screen and redrawing it actually slows the exectution of the program, and learning to overwrite only portions of the screen, it was a bit of struggle when, for e.g. blitzbasic, needed to clear the screen and do the redrawing in code ...
There is a thinking difference between the two types of programming.
Mon, 31 May 2021, 08:21
Jayenkai
Yeah, the old methods are full of "tricks" to get as much out of the hardware as you can.
Learning to draw sprites that work well when xor'd, so that you can xor them onto the screen, then xor them back off without needing to redraw anything else.. Awesome!!!

This is less about "oldskool techniques", though, and more about how mindlessly overly-complicated the C64 methodology was.

And don't even get me started on trying to relearn how to type ANYTHING on a ZX Spectrum.

The CPC might not have been the super-powerful megatastic powerhouse that it looked, but at least you could type properly with letters, print properly without fear of random chaos happening, and change colours using change colour commands instead of having to use cryptic symbols!!!

-=-=-
''Load, Next List!''
Mon, 31 May 2021, 14:18
rockford
Actually, with the CPC you COULD use cryptic symbols (eg the character set below 32) to do strange things, eg IIRC CHRS(22 or 23?) allowed you to print over the top of another character in a different colour, without destroying what was underneath. There were also characters to clear the screen etc. Although my memory of this is over 30years old and may be in error.

Yep - as stated here - https://en.wikipedia.org/wiki/Amstrad_CPC_character_set The character set could be used to do some nice weird stuff.
Mon, 31 May 2021, 14:29
Jayenkai
Yes the "control characters" are, and always have been, things under chr(32)
Even today, those still exist.
When you write
For n=32 to 255: print chr$[n);:Next n

You don't expect it to clear the screen, halfway, and turn everything a different colour!

-=-=-
''Load, Next List!''
Mon, 31 May 2021, 15:23
AndyH
Actually, the C64 isn't overly complicated ... just that it's BASIC is too simplistic and didn't have anything built in to interface with the hardware.

Coming from the Vic 20 --> Amstrad --> ST --> Amiga --> C64 --> PC --> Spectrum --> Vic 20 (again) it doesn't seem at all alien but I can see how wierd it is if never been over that side of the fence.

Amstrad BASIC was a lot more fun to use, although I did miss some of the things you could do with the Vic character set display (which the C64 also has).

That said, I suppose the way BASIC is implemented on the Vic/C64 is in keeping with the way 6502 works and having the knowledge about the pokes and such is not a disadvantage when moving to assembler orjust going a little beyond what would otherwise need to be a BASIC command.

-=-=-
Andy H
8-bit games at www.hewco.uk
Cartoons at awful.ovine.net
Ovine at ovine.net
Mon, 31 May 2021, 15:27
rockford
Whut? WTF? Why would they not exist today? Nobody ever said otherwise. Bizarro. When I said "strange" things, I meant things that were usually coded (or would require code), not just "random" strange.

Anyway, no, they aren't (and weren't) random, but neither are the C64s. Even if they were bonkers.
Mon, 31 May 2021, 16:37
Jayenkai
It's just so odd to see it behaving like that.
I guess with the CPC being the relative newcomer, things had progressed enough for that not to happen, but...
It's still really messed up!
Of course, the CPC had its own ways to do things like that. Specific CALLs could trigger all manner of things, but those were out of the way, not right in the middle of the chr set!!

-=-=-
''Load, Next List!''
Tue, 01 Jun 2021, 01:59
Pakz
After seeing a Amiga and several games and demo's the c64 in our home was gone really quickly and replaced with a a500 That external drive for the c64 and a power cartridge and final cartridge was fun when I had it though! I stil remember a friend bringing over his entire collection of c64 games and leaving it at our home for a couple of days!
Tue, 01 Jun 2021, 05:12
AndyH
The manual that comes with the C64 and Vic 20, and the programmers reference guides are really good. Printing chr$ codes puts it through a very poweful routine on the Commodore as said you can do HOME, Clear screen, cursor movements, change colour, change between uppercase and graphic characters or upper and lower case characters and others - but if you do it blindly you will not know what is happening. Again, the documentation is good and if you've never used the machine before it is, like most late 70'd/early 80's computers, a unique beast of it's own. This is something I love about old machines, they each have their own character.

Oh, and you may have heard about PETSCII ? Originating from the CBM/PET it is a variant of ASCII and has some compatibility to a degree but is not the same. PETSCII is more to do with the 'screen codes' that are the direct mappings between numbers 0 - 255 and what character from the ROM is used to display something on the screen. CHR$ is ASCII 0 - 127 though, alhtough with Commodores own extensions. If you want to know what that looks like take a look at this page and the following page: www.manualslib.com/manual/950679/Commodore-Vic-20.html?page=288#manual

As a side note on BASIC on the Commodore, the story goes that Jack had bought BASIC 2.0 from Microsoft with no restrictions on how many machines it was put on. There were better versions of BASIC (version 4 with disk commnands appeared on the later Pet's for example) but the Vic 20 and C64 were stuck with 2.0. I suspect that ROM size and keeping cost down was the main reason Commodore had a basic BASIC.

-=-=-
Andy H
8-bit games at www.hewco.uk
Cartoons at awful.ovine.net
Ovine at ovine.net
Tue, 01 Jun 2021, 07:34
cyangames
I might have a try at some assembly for the c64, it's almost identical in terms of commands to the NES and I have a mate who's turning 40 this year who is a big fan of the C64 so

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Tue, 01 Jun 2021, 08:28
Dan
After reading your post, i JFF googled for "mario age" :


Tue, 01 Jun 2021, 15:53
cyangames
ha! rather convenient that
Sat, 19 Jun 2021, 23:41
Dan
I've just watched this youtube video:

View on YouTube

and when it got to the introduction of the keyboard, i got reminded of this thread.
Sat, 27 Nov 2021, 11:07
Jayenkai


I've been informed, multiple times on Twitter, that this was "Normal" on Commodores.

This is NOT normal BASIC.
My god, that horrible!!
I'm willing to bet that everyone who grew up hating BASIC, did so because they had to deal with crap like that.

Bloody hell.

youtu.be/37GqnTiBtEM

-=-=-
''Load, Next List!''
Sat, 27 Nov 2021, 12:08
rockford
TBF It is BASIC, just without the spaces.

Why did they not just use "O" for the snake in that C64 example. Or Asterisk. Or anything other than what they did use?
Sun, 28 Nov 2021, 04:58
AndyH
I can explain what you are seeing...

The way a BASIC program is stored in memory is along the lines of:

> Line number, address of next line, The BASIC stuff, zero terminator to mark the end of the line.

Where The BASIC stuff is either tokens (eg: a single byte value represents PRINT instead of the word PRINT being stored) or a litteral value, eg a SPACE, a number or the letters in a string.


Commodore BASIC allows you to put as many spaces in as you want but does not force you to do so. There is a speed advantage of not putting spaces in because the BASIC interpretter will have fewer characters to look at. Also as a result a BASIC program with no spaces uses less memory than one with spaces. For this reason you may often see BASIC like the above.

I have never found that to be a problem. I'm trying to remember if there were any tools available at the time that would add/remove spaces for readability/optimisation? There certainly is in cross development with CBM PRG Studio supporting it. I had the Programmers Aid Cartridge for the Vic 20 which I remember had a line renumber feature but can't recall if it did optimisations. The Vic 20 manual described the 'trick' to remove spaces in its optimisation section, pretty handy as the unexpanded Vic 20 only had 3583 bytes available for BASIC programs by default.

@Rockford - I can't understand what they are saying in the video, but the way they have implemented the snake routine is to use a character to tell it what direction the body is moving in and the visual representation is meant to be an indication of this. It looks awful though, I would much prefer the circle. They'd have to implement the snake movement differently to allow that.

-=-=-
Andy H
8-bit games at www.hewco.uk
Cartoons at awful.ovine.net
Ovine at ovine.net
Sun, 28 Nov 2021, 05:19
Jayenkai
Yep, I understand the reasoning behind it.
.. but not all BASICs worked like that.
Amstrad Locomotive (to the best of my knowledge) certainly didn't.
It's horrific that code should (and indeed CAN) be written like that, and I bet folk hated BASIC because of stuff like that.

.. 'cos I'm pretty damn sure it wasn't just GOTO!!

-=-=-
''Load, Next List!''
Sun, 28 Nov 2021, 05:32
Pakz
I was watching a youtube video on the c64 game Pirates. There was shown how to 'hack' the game to show the sourcecode. A good part of the game was written in c64 basic. Only the important parts were done with those machine code parts.

Edit :

View on YouTube
Sun, 28 Nov 2021, 05:33
AndyH
No, I disagree. Not sure how Amstrad BASIC was stored in memory, and you have no disagreement that Amstrad BASIC was more refined and a nicer BASIC to use, but I never had a problem with Commodore's BASIC and I don't really know of anyone who complained about it, other than the obvious things that people complain about (speed, not having this or that feature etc) which is common to any implementation of BASIC from back in the day.

Commodore BASIC was written by Microsoft as you may know and comes from the 1970's with the PET/CBM machines. The Vic and C64 were unfortunately stuck with version 2 of this BASIC because Jack Tramiel had signed a contract that effectively allowed him to use it as much as he wanted in any machine so as a tight arse refused to pay for these machines to have a newer or expanded version of it.

Your interest in this may vary, but here's a small program and the way it is stored in memory:


I get what you are saying, it's just what you are used to. My love of BASIC comes from the Vic 20 and then the CPC 464. I used a bit of STOS and AMOS, but by then I was getting into 68000 and BASIC lost its shine for me. I have a similar feeling about ZX BASIC - other people love it, but it is just weird and I don't understand it and as I didn't use it at the time I don't know it well enough. The best BASIC from the time seems to be for the BBC / Electron BASIC, but at the end of the day BASIC is just a tool for us early 80's wanna-be programmers to make cool things.

I don't expect to ever convince you, but there is nothing wrong with Commodore's BASIC as it served the machines perfectly well.

-=-=-
Andy H
8-bit games at www.hewco.uk
Cartoons at awful.ovine.net
Ovine at ovine.net
Sun, 28 Nov 2021, 05:43
Jayenkai
I shall never be convinced!!!!

Unreadable code should be a coder's choice, not a way to make the language quicker!

-=-=-
''Load, Next List!''
Sun, 28 Nov 2021, 05:47
AndyH
hehe - it's ok because we know you are wrong

-=-=-
Andy H
8-bit games at www.hewco.uk
Cartoons at awful.ovine.net
Ovine at ovine.net
Page : 1 2 Next
Prev