Jump to content
  • entries
    469
  • comments
    324
  • views
    406,715

From Qbasic to Commodore Basic v2.0


Serguei2

3,683 views

Hi there

 

I was thinking making a new Commodore game who will work on C64, Vic-20 or C16/+4.

 

It's a text adventure game.

 

blogentry-1196-0-44009200-1361834372_thumb.png

 

Before starting a new game, I'll check if I can put DG: a text adventure game to work on Commodore computers.

 

I noted that Commodore Basic 2.0 lacks some commands found on Basica or GwBasic like While, Wend, Print Using "Money : ####"

 

After a few tries I managed to make the DG text to work on Commodore computers.

 

DG text on C64

blogentry-1196-0-84426200-1361834756_thumb.png

 

DG text on Vic 20 (24k)

blogentry-1196-0-82166900-1361834833_thumb.png

 

DG text on Plus 4 / C16 (32k)

blogentry-1196-0-81266700-1361835986_thumb.png

 

 

The first problem is to convert the game from qbasic to basic, not just by adding numbers at the begin of the command line but also reworking some commands to make the game to run.

 

And it's worst on Basic 2.0. Some commands on Basica are not exist on Basic 2.0

 

DG text on Basica works but not all rooms. Complexe rooms are not coded yet.

 

Simple rooms work fine but more complexe rooms need more work to run.

 

blogentry-1196-0-57389100-1361835320_thumb.png

 

Some codes on C64

 

Anyway. It's a funny way to explore Basic in different computers.

 

 

Robin Gravel

 

Edited: the commodore DG game uses the same program. There is no vic-20 version or C64 version or Plus 4/C16 version.

7 Comments


Recommended Comments

I used to love programming in BASIC on my Vic20, C64, and Apple IIc. It's been years since I owned any of those pieces of hardware, and just as long since I coded in their languages. Since then I had gotten quite used to more modern languages and their features.

 

I recently purchased Petit Computer for the DS (lets you program in BASIC on the DS) and it has been quite a shock all the things I've been taking for granted. For instance, there is no such thing as a group of statements in an IF... THEN. If I want to execute more than a single command I have to call a subroutine (or a reasonable facsimilie since there are no explicit subroutines either). So far I can find no indication of user defined functions with encapsulated variables. And there's no indentation for readability. It takes quite a bit of adaptation to move backwards.

 

Thank goodness there are at least named labels so I don't have to reference specific line numbers in Gosubs.

 

So, I feel your pain.

Link to comment

For instance, there is no such thing as a group of statements in an IF... THEN. If I want to execute more than a single command I have to call a subroutine (or a reasonable facsimilie since there are no explicit subroutines either).

 

That's easy to work around. Say you want to do this:

 if a = 10 then
   a = 20
   b = 30
   c = 40
 endif

 

invert the test case and use goto

 if a <> 10 then goto skip
   a = 20
   b = 30
   c = 40
skip:

Link to comment

Thanks SpiceWare. That makes sense.

 

 

110 if a <> 10 then goto 150

120 a = 20

130 b = 30

140 c = 40

150 REM skip

 

Commodore Basic uses numbers noit labels.

Link to comment

Many BASIC also allow for multiple commands on a single line, e.g.

110 if a = 10 then a = 20 : b = 30 : c = 40

120 REM endif

Link to comment

How about making user functions that would work on both QuickBASIC and C64? Wouldn't that be one way of making cross platform games?

Link to comment

Many BASIC also allow for multiple commands on a single line, e.g.

110 if a = 10 then a = 20 : b = 30 : c = 40

120 REM endif

 

Yeah! But Basica/Qbasic can have 255 characters per line while Basic 2.0 only has 80 characters per line.

Link to comment

How about making user functions that would work on both QuickBASIC and C64? Wouldn't that be one way of making cross platform games?

 

DG: a text adventure game is not designed for porting to Basic 2.0 in mind. But new games will.

 

The best way to port from PC to Basic 2.0 is to use Basica unstead Qbasic to make new games. Because Qbasic is more advanced than Basica and it does not need numbers as labels.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...