Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Modifying 1551 disk drive for C64/128 (and other questions)...

264 views
Skip to first unread message

Paul Allen Panks

unread,
Apr 6, 2002, 8:44:25 PM4/6/02
to
Hey all,

I have a couple of questions:

1) Can the 1551 disk drive (for the plus/4 and 16) be modified for use
on the Commodore 64/128?
2) Can I install a VIC-II chip in the Plus/4? How about a SID?
3) Why own a C=16 when the Plus/4 has more memory? And they are
compatible?

That's about it. I'm still trying to figure out GSHAPE AND SSHAPE to
save graphical images for display as quasi-sprites on the Plus/4.
Anyone know how to do this, and perhaps have a demonstration example
they could post?

Paul

Richard Atkinson

unread,
Apr 7, 2002, 6:41:39 AM4/7/02
to
On 6 Apr 2002, Paul Allen Panks wrote:

> 1) Can the 1551 disk drive (for the plus/4 and 16) be modified for use
> on the Commodore 64/128?

Theoretically yes it can, and in fact the early PRGs for the C64 indicate
the 1551 (or something like it) was originally intended for the C64.

It's the adaptor cartridge you'd need to modify, or build a C64 cartridge
port device which the 1551 cartridge can plug into. I'm not sure how
difficult timing issues would be. You'd also want to port the 264 series
TCBM I/O routines (source available from CBM in German) to work on the 64
kernal.

> 2) Can I install a VIC-II chip in the Plus/4? How about a SID?

VIC-II and TED are sufficiently fundamental to the operation of the
machine that it's difficult to see how one could be added without
requiring its own seperate memory and some (slow) method of actually
accessing that memory. SID, on the other hand, is added to plus/4s and
C16s quite often, in the form of the Hungarian $FE80 SID cartridge and the
German $FD40 (and Hungarian-compatible) "SIDcard".

> 3) Why own a C=16 when the Plus/4 has more memory? And they are
> compatible?

Because a C16 has a different keyboard? That maybe someone out there
actually likes? Personally, I think the plus/4 has the best keyboard CBM
ever made, and the C16's arrow keys and placement of (UK pound sign) and
'=' annoy the hell out of me. But you can upgrade the C16 to 64K without
any trouble at all.


Richard

Sam Gillett

unread,
Apr 7, 2002, 6:53:09 PM4/7/02
to

Paul Allen Panks wrote ...

>That's about it. I'm still trying to figure out GSHAPE AND SSHAPE to
>save graphical images for display as quasi-sprites on the Plus/4.
>Anyone know how to do this, and perhaps have a demonstration example
>they could post?


The following information applies to the 40 column screen of the C128. IIRC
the syntax and function of graphic commands in Plus/4 Basic are the same as,
or nearly the same as in C128 Basic.

SSHAPE / GSHAPE

Save/retrieve shapes to/from string variables. SSHAPE and GSHAPE are used
to save and load rectangular areas of bit map screens to/from BASIC string
variables. The command to save an area of the bit map screen into a string
variable is:

SSHAPE string variable, X1, Y1 [,X2, Y2]

where:

string variable = String name to save the data in
X1, Y1 = Corner coordinate (0,0 through 319,199) (scaled)
X2, Y2 = Corner coordinate opposite (X1, Y1) (default is the PC)

The command to retrieve (load) the data from a string variable and display
it on specified screen coordinates is:

GSHAPE string variable [X,Y][,mode]

where:

string variable = Name of string containing shape to be drawn
X,Y = Top left coordinate (0,0 through 319,199) telling where to draw the
shape (scaled - the default is the pixex cursor)
mode = replacement mode:
0 = place shape as is (default)
1 = invert shape
2 = OR shape with area
3 = AND shape with area
4 = XOR shape with area

The replacement mode allows you to change the way the data in the string
variable is displayed so you can invert it, perform a logical OR, exclusive
OR (turn off bytes that are on), or AND operation on the image.

EXAMPLES:

SSHAPE A$,10,10 Saves a rectangular area from the coordinates 10,10 to
the location of the pixel cursor, into string variable A$.

SSHAPE B$,20,30,43,50 Saves a rectangular area from top left coordinate
(20,30) through bottom right coordinate (43,50) into string variable B$.

SSHAPE D$,+10,+10 Saves a rectangular area 10 pixels to the right and 10
pixels down from the current position of the pixel cursor. (IIRC, the PC
would be the top, left position in this example, and bottom would be 10
pixels relative to the PC as would right)

GSHAPE A$,120,20 Retrieves shape contained in string variable A$ and
displays it at top left coordinate (120,20).

GSHAPE B$,30,30,1 Retrieves shape contained in string variable B$ and
displays it at top left coordinate 30,30. The shape is inverted due to the
replacement mode being selected by the 1.

GSHAPE C$,+20,+30 Retrieves shape from string variable C$ and displays it
20 pixels to the right and 30 pixels down from the current position of the
pixel cursor.

NOTE: Beware of using modes 1-4 with multi-color shapes. You may obtain
unpredictable results.

The preceeding is, except for the IIRCF notes, referenced to the C128 PRG.

I also have a sample program on disk (28 lines), which I will post shortly.

Best regards,

Sam Gillett aka Mars Probe @ Starship Intrepid 1-972-221-4088
Last 8-bit BBS in the Dallas area. Commodore lives!

Sam Gillett

unread,
Apr 7, 2002, 8:18:19 PM4/7/02
to

Paul Allen Panks wrote ...

>That's about it. I'm still trying to figure out GSHAPE AND SSHAPE to


>save graphical images for display as quasi-sprites on the Plus/4.
>Anyone know how to do this, and perhaps have a demonstration example
>they could post?

This example program runs as is on the 40 column screen of the C128. IIRC,
the graphics portion will also work on the Plus/4. I think you will need to
modify the display portion of the program to adapt it to the Plus/4, as I
don't remember the Plus/4 having the DO/LOOP commands.

10 REM DRAW, SAVE AND GET THE COMMODORE SYMBOL
20 COLOR 0,1:COLOR 4,1:COLOR 1,7
30 GRAPHIC 1,1:REM SELECT BMM
40 CIRCLE 1,160,100,20,15:REM OUTER CIRCLE
50 CIRCLE 1,160,100,10,9:REM INNER CIRCLE
60 BOX 1,165,85,185,115:REM ISOLATE AREA TO BE ERASED
70 SSHAPE A$,166,85,185,115:REM SAVE THE AREA INTO A$
80 GSHAPE A$,166,85,4:REM EXCLUSIVE OR THE AREA-THIS (ERASES) TURNS OFF
PIXELS
90 DRAW 0,165,94 TO 165,106:REM TURN OFF (DRAW IN BKGRND COLOR) PIXELS IN
"C="
100 DRAW 1,166,94 TO 166,99 TO 180,99 TO 185,94 TO 166,94:REM UPPER FLAG
110 DRAW 1,166,106 TO 166,101 TO 180,101 TO 185,106 TO 166,106:REM LOWER
FLAG
120 PAINT 1,160,110:REM PAINT "C"
130 PAINT 1,168,98 :REM UPPER FLAG
140 SLEEP 5:REM DELAY
150 SSHAPE B$,137,84,187,116:REM SAVE SHAPE INTO B$
160 DO
170 SCNCLR
180 Y=10
190 DO
200 X=10
210 DO
220 GSHAPE B$,X,Y:REM GET AND DISPLAY SHAPE
230 X=X+50:REM UPDATE X
240 LOOP WHILE X<280
250 Y=Y+40:REM UPDATE Y
260 LOOP WHILE Y<160
270 SLEEP 3
280 LOOP

James

unread,
Apr 7, 2002, 10:16:10 PM4/7/02
to
Sam,

I do not know about the 128, but the Plus/4 allows a maximum length of
255 characters for a text string. This applies to the SSHAPE command
as well as the normally used A$="textstring here".

I believe that each character-cell-sized-area takes 8 bytes in a
SSHAPE command. Therefore a SSHAPE A$ 0,0,8,8 takes 8 characters of
A$; SSHAPE A$ 0,0,16,16 would take 24, etc.

James C


"Sam Gillett" <samgi...@msn.com> wrote in message news:<p54s8.17270$7F1....@nwrddc02.gnilink.net>...

Sam Gillett

unread,
Apr 7, 2002, 11:51:55 PM4/7/02
to

James wrote ...

>I do not know about the 128, but the Plus/4 allows a maximum length of
>255 characters for a text string. This applies to the SSHAPE command
>as well as the normally used A$="textstring here".

Yes, the C128 (and C64) share the 255 character limit on string length.

>I believe that each character-cell-sized-area takes 8 bytes in a
>SSHAPE command. Therefore a SSHAPE A$ 0,0,8,8 takes 8 characters of
>A$; SSHAPE A$ 0,0,16,16 would take 24, etc.

Somewhere I have a book that goes into great detail about the way SSHAPE
stores bit map areas in a string. It also details the max size of the area
that can be saved with SSHAPE. Can't find it right now though.
Paul may need to do a little trial and error testing to determine the
exact limits of the command.

0 new messages