Welcome, Guest. Please login or register.

Author Topic: C64 Basic Upgrade  (Read 18731 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline nicholas

Re: C64 Basic Upgrade
« Reply #29 from previous page: March 28, 2013, 09:26:05 PM »
Quote from: trekiej;730655
Solution:
A C compiler on disk.


FTFY. Basic is for 10yr olds. ;)
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline trekiejTopic starter

Re: C64 Basic Upgrade
« Reply #30 on: March 28, 2013, 09:36:42 PM »
Well I do have Power C on D64.
It uses C99.
edit:
Basic is great for doing some quick programming.
The programmer could make a quick analysis of some data.
« Last Edit: March 28, 2013, 09:46:07 PM by trekiej »
Amiga 2000 Forever :)
Welcome to the Planar System.
 

Offline nicholas

Re: C64 Basic Upgrade
« Reply #31 on: March 28, 2013, 09:50:10 PM »
Quote from: trekiej;730661
Well I do have Power C on D64.
It uses C99.
edit:
Basic is great for doing some quick programming.
The programmer could make a quick analysis of some data.

Sorry, I was just playing.  I couldn't resist it.  I first learned to code using Basic on my Plus/4 as a kid so I have fond memories of it. :)

I might have to have a look at Power C, sounds interesting.

How is compilation speed?  I imagine it would be quite slow given the CPU and RAM constraints.
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline psxphill

Re: C64 Basic Upgrade
« Reply #32 on: March 29, 2013, 08:45:57 AM »
Quote from: nicholas;730399
No, but it had 60k of accessible RAM and could display 128 colours onscreen. The c64 had less than 40k of usable RAM and 16 colours so it's a fair trade. :)
 
edit: Faster CPU, serial port and floppy drive too.
 
Yeah, there are quite a few demos that use them.

The extra ram was due to the plus4 bankswitching when accessing code and data behind the roms, the C64 could have done that too. IIRC there were some cartridges that did it, you could probably hack the BASIC rom as well.
 
The C64 had a drive available that was better than a 1551 (http://www.c64-wiki.com/index.php/SFD-1001) the sales figures for both are unlikely to be very exciting.
 
The serial port was good, but for the majority it was unused and you could add one to the c64 anyway.
 
For the target business market the TED was probably ok, but the lack of sprites and the poor sound really destroyed it in the games market. They could have added a SID chip, which would have free'd up space for doing sprites on TED. But the whole point of TED was to fit sound and graphics in one chip.
 
I think the real mistake CBM made was that they still didn't have a better graphics chip available for the C128. An 80 column VIC would have been pretty awesome.
 

Offline LoadWB

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 2901
  • Country: 00
    • Show only replies by LoadWB
Re: C64 Basic Upgrade
« Reply #33 on: March 29, 2013, 02:28:53 PM »
The limited amount of available RAM in the C64 is only apparent to basic BASIC programs.  Using ML purely (or even in concert with BASIC) you can swap out the BASIC ROM and "open up" 4k of RAM.  You can also swap out I/O space for another 4k.  If you can get away with it, you can swap out the Kernal for yet another 4k.  Some memory has to be set aside for color and video memory; no biggie.

I wrote a BBS program which uses RAM under ROM and I/O for various tasks and modules.  The trick is to make sure you don't have a particular ROM swapped out when you decide to use a routine contained within (like floating point math while BASIC is out or disk access routines while Kernal is swapped out) or attempt to access I/O devices with that space swapped out.

If you've never programmed the 64 in machine language/assembly, you're missing out.  It's a ton of fun manipulating the hardware and running "on the metal."
 

Offline trekiejTopic starter

Re: C64 Basic Upgrade
« Reply #34 on: April 02, 2013, 09:21:45 PM »
C for the C64 has not received much good press here.
Maybe this link will help.
http://www.lyonlabs.org/commodore/powerc.html

Quote from: nicholas;730663
Sorry, I was just playing.  I couldn't resist it.  I first learned to code using Basic on my Plus/4 as a kid so I have fond memories of it. :)

I might have to have a look at Power C, sounds interesting.

How is compilation speed?  I imagine it would be quite slow given the CPU and RAM constraints.
Amiga 2000 Forever :)
Welcome to the Planar System.
 

Offline psxphill

Re: C64 Basic Upgrade
« Reply #35 on: April 02, 2013, 11:26:34 PM »
Quote from: trekiej;730661
Well I do have Power C on D64.
It uses C99.

C99 came out in 1999, has Power C been updated?
 
It's more likely to be C89 but here http://www.lyonlabs.org/commodore/powerc.html it suggests using K&R style arguments to functions, which I'd find a major pain.
 

Offline trekiejTopic starter

Re: C64 Basic Upgrade
« Reply #36 on: April 02, 2013, 11:34:22 PM »
Quote from: psxphill;731033
C99 came out in 1999, has Power C been updated?
 
It's more likely to be C89 but here http://www.lyonlabs.org/commodore/powerc.html it suggests using K&R style arguments to functions, which I'd find a major pain.


Oops.
It does say pre-Ansi.
Amiga 2000 Forever :)
Welcome to the Planar System.
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: C64 Basic Upgrade
« Reply #37 on: April 02, 2013, 11:51:03 PM »
Quote from: nicholas;730399
No, but it had 60k of accessible RAM and could display 128 colours onscreen. The c64 had less than 40k of usable RAM and 16 colours so it's a fair trade. :)


FYI all 64K of the C64's RAM is accessible.  I wrote lots of BASIC programs and I always used all 64K of RAM.

The 38911 byte limit is only for newbs :)
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline LoadWB

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 2901
  • Country: 00
    • Show only replies by LoadWB
Re: C64 Basic Upgrade
« Reply #38 on: April 03, 2013, 01:08:32 AM »
Quote from: ChaosLord;731037
FYI all 64K of the C64's RAM is accessible.  I wrote lots of BASIC programs and I always used all 64K of RAM.

The 38911 byte limit is only for newbs :)


TECHNICALLY all but two bytes are accessible.  $00 and $01 are on-chip registers on the 6510. :D
 

Offline trekiejTopic starter

Re: C64 Basic Upgrade
« Reply #39 on: April 03, 2013, 01:26:38 AM »
Quote from: LoadWB;731045
TECHNICALLY all but two bytes are accessible.  $00 and $01 are on-chip registers on the 6510. :D


Whoa, that is really deep!
Amiga 2000 Forever :)
Welcome to the Planar System.
 

Offline psxphill

Re: C64 Basic Upgrade
« Reply #40 on: April 03, 2013, 10:15:56 AM »
Quote from: ChaosLord;731037
FYI all 64K of the C64's RAM is accessible. I wrote lots of BASIC programs and I always used all 64K of RAM.
 
The 38911 byte limit is only for newbs :)

You can't use more than 38911 for code.
 
You should be able to use c000 for variables, but that can't be in addition to anything in the 38911 area.
 
All that rest can only be accessed with POKE and PEEK, which is a tad boring to code. Using the upper ram for VIC is probably your best bet.
 
I ran out of ram in a basic program once and then I stopped writing basic programs.
 

Offline rewlako

  • Newbie
  • *
  • Join Date: Apr 2012
  • Posts: 41
    • Show only replies by rewlako
Re: C64 Basic Upgrade
« Reply #41 on: April 03, 2013, 10:47:45 AM »
-
« Last Edit: April 03, 2013, 10:51:58 AM by rewlako »
 

Offline nicholas

Re: C64 Basic Upgrade
« Reply #42 on: April 05, 2013, 10:43:17 PM »
Quote from: psxphill;730699
For the target business market the TED was probably ok, but the lack of sprites and the poor sound really destroyed it in the games market. They could have added a SID chip, which would have free'd up space for doing sprites on TED. But the whole point of TED was to fit sound and graphics in one chip.
 

Yeah, the sound was pretty dire but it was possible to do some nice tricks with it though.

19KHz replay routine

Quote from: LoadWB;730710
The limited amount of available RAM in the C64 is only apparent to basic BASIC programs.  Using ML purely (or even in concert with BASIC) you can swap out the BASIC ROM and "open up" 4k of RAM.  You can also swap out I/O space for another 4k.  If you can get away with it, you can swap out the Kernal for yet another 4k.  Some memory has to be set aside for color and video memory; no biggie.

I wrote a BBS program which uses RAM under ROM and I/O for various tasks and modules.  The trick is to make sure you don't have a particular ROM swapped out when you decide to use a routine contained within (like floating point math while BASIC is out or disk access routines while Kernal is swapped out) or attempt to access I/O devices with that space swapped out.

If you've never programmed the 64 in machine language/assembly, you're missing out.  It's a ton of fun manipulating the hardware and running "on the metal."

I've done some but not nearly enough! :)

Whilst convalescing for the last week or so after surgery I've been reacquainting myself with Rodnay Zaks "Advanced 6502 Programming" book and the old Commodore Hacking series by Craig Taylor to pass the time.

I must say that I've got the bug and will be spending my free time with VICE and YAPE for the foreseeable future (In no small part due to the fact that I've become bored with Amiga's again.)

Quote from: psxphill;731033
C99 came out in 1999, has Power C been updated?
 
It's more likely to be C89 but here http://www.lyonlabs.org/commodore/powerc.html it suggests using K&R style arguments to functions, which I'd find a major pain.

Ouch!  I wonder what C compiler is used for the Contiki OS on 8bit machines?
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline nicholas

Re: C64 Basic Upgrade
« Reply #43 on: April 05, 2013, 10:54:57 PM »
Quote
C64 "demos" were the root of the whole demo-scene-thing and they are  still the main force keeping the C64 alive today. Audiovisual pleasure,  still pushing hardware limits, still exploring different ways of  expression. But what is typically happening inside the machine when you  watch a demo? What effort is needed to entertain the audience? This talk  will give you an inside look at the steps taken for the award winning  demo "Error 23" given first hand by one of its main programmers.

This  talk extends previous talks and documentation about the Commodore 64  and its demo effects by adding real-life challenges and experiences to  it. What were the basic ideas? What obstacles were on the way? How did  they get solved? 6502 assembly knowledge is really not required, some  general understanding about assembly and low-level computing will be  useful, though (think of stack, timer, cycles...). This isn't about  theory, this is for real ;)

Topics include (but not limited to):

Explaining design choices
Basic ideas behind the effects
Data compression techniques
Load stuff while displaying effects
Dirty tricks which make your computer science professor run away
Synchronization and linking
how to keep it all in 64KB RAM

Speaker: Ninja / The Dreams
EventID: 4814
Event: 28th Chaos Communication Congress (28C3) by the Chaos Computer Club [CCC]
Location: Berlin Congress Center [bcc]; Alexanderstr. 11; 10178 Berlin; Germany
Language: english
Start: 29.12.2011 21:45:00 +01:00
License: CC-by-nc-sa
[youtube]So-m4NUzKLw[/youtube]

That's my next 60 minutes spoken for. :)
« Last Edit: April 05, 2013, 11:01:18 PM by nicholas »
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline LoadWB

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 2901
  • Country: 00
    • Show only replies by LoadWB
Re: C64 Basic Upgrade
« Reply #44 on: April 06, 2013, 12:20:37 AM »
Quote from: LoadWB;730710
The trick is to make sure you don't have a particular ROM swapped out when you decide to use a routine contained within (like floating point math while BASIC is out or disk access routines while Kernal is swapped out) or attempt to access I/O devices with that space swapped out.

I forgot to mention the IRQ and NMI handling.  If you don't have your own IRQ and NMI routines (or turn off the IRQ) when you swap out the Kernal, you're heading right straight into a lock-up when the interrupt gets vectored by, and usually into, uninitialized memory.