-
Notifications
You must be signed in to change notification settings - Fork 3
Extended Commands
Since Commodore Basic V2 is limited compared to other languages, when it comes to graphics, music, etc, some extended commands have been added to help for those that want to code in Commodore 64 basic and environment, but still want have a few "modern comforts" available.
The Extended commands can be seen, as commands that would normally come in a cartridge, and expand the Commodore 64. Some of these are Final Cartridge, Power Card ridge and Simon's Basic.
The extended commands are not copied from any other cartridge, but new re imagined commands instead.
Turn on Extended commands.
Turn off Extended commands.
List Extended commands.
Read the directory, but do not destroy the basic listing.
Delete a file.
Set the label of the disk to the desired name.
LIST all lines which contains the specified search-string.
Return the screen mode to readable text. In case you got stuck with unreadable text, or in hires mode.
Same as the print command, but the output goes into the debugging console.
When you did a new command, and just realized you should not have.
Change line-numbers in your program
PLANNED: Renumber also takes in consideration which method to use.
There are these methods.
1. plain. It just renumbers using startline and step
2. data. It renumbers like in plain. But all data statements line numbers start with 1000, 2000, etc.
3. rem. Each line starting with "REM -", starts on the next 1000. (REM - indicates a code section)
Normalize spaces inside your program
Reset the basic emulator
Put the emulator in turbo mode. Your program should be approx. 50x faster. Tip: The cursor will flicker quicker when in Turbo mode, so you will be able to tell quickly when in editing mode.
Synchronizing the time of the emulator with your host computer. By default, 00:00:00 is set to the time the emulator was started.
Slow down turbo mode, and wait for the next loop-jiffy to expire. Only use for "Lazy Timing", since a loop-jiffy is approx 1/50th of a second, but this may not be accurate.
Put the emulator in normal mode. (ie. exit Turbo mode).
Returns a point on a hypothetical line, between beginning (_Progress=0) and end (_Progress=1). _XOut and _YOut are output parameters, and must be variables.
Select between the different text and graphics modes.
- 0 - Text mode, mono color
- 1 - Text mode, multi color
- 2 - Hires, mono color
- 3 - Hires, multi color
Set the color registers to a specified color index.
Examples:
- COLOR 0,1 : REM SET BORDER TO WHITE
- COLOR 1,0 : REM BACKGROUND COLOR TO BLACK
The colors that can be set this way are.
- 00 - Border color
- 01 - Background Color
- 02 - Background/Multi Color #1
- 03 - Background/Multi Color #2
- 04 - Sprite/Multi Color #1
- 05 - Sprite/Multi Color #2
- 06 - Sprite color 1
- 07 - Sprite color 2
- 08 - Sprite color 3
- 09 - Sprite color 4
- 10 - Sprite color 5
- 11 - Sprite color 6
- 12 - Sprite color 7
- 13 - Sprite color 8
Set the border color. This is equivalent to COLOR 0,_ColorIndex.
Clear the screen
Setting pen color to the specified color index, between (0-15).
Setting pen position to the specified x,y position.
Change a character on the screen to character with _CharCode
Retrieve a character code from the screen on position _X, _Y
Change a character color on the screen to color _Color
Retrieve a character color from the screen on position _X, _Y
Clear the screen for Graphics or bitmap mode.
Set the color-short-index for the graphics pen. This short index is either; 0,1,2 or 3 Each color cell on the screen, can have a maximum of 4 colors. Depending on the graphics mode, these 4 colors can be set per cell, or are global.
This is related to the GPEN command. The _ColorShortIndex will be used to draw pixels to the screen. But the color cell decides the actual color that will be displayed for each short-index (between 0 and 2). With this command you can tell the graphics pen, to not only draw the pixels with the _ColorShortIndex, but also set the color cell so that these short indexes will match the desired display color. If this is confusing, you should read more about color cells on the Commodore 64. On the C64, and other 8-bit computers it is not that simple to just plot a blue pixel on the screen. First you need to plot the pixel, and then you need to tell the color cell in which it lays, what color the pixel is supposed to be displayed at.
This command is equal to running in sequence GCOLDEF 0,_firstcolor: GCOLDEF 1,_secondcolor: GCOLDEF 2,_thirdcolor
Draws a line with the current pen and color definitions.
Draws a box with the current pen and color definitions.
Draws a horizontal line with the current pen and color definitions.
Draws a horizontal line with the current pen and color definitions.
Draws a single pixel with the current pen and color definitions.
Retrieves a single pixel. The returned value will be the _ShortColorIndex of the pixel.
Retrieves the color of single pixel. The returned value will be the _ColorIndex of the pixel.
Enables or disables sprite _SPNO (0-7). _ONOFFFLAG is 1 for enable, 0 for disable
Positions the sprite _SPNO on position _X, _Y
Sets the sprite _SPNO to color _COL
Sets the sprite _SPNO to color mode _COLORMODE
- ColorMode: 0 -> Single color hires spite
- ColorMode: 1 -> Multi color lores sprite
Expand the sprite _SPNO in 2x size. _DOUBLE and _YDOUBLE, can be 0 for false, 1 for true
Sets the sprite _SPNO to the frame _FRNO
Sets a byte sprite memory inside frame _FRNO, on offset _OFF (0-62)
Copies/Clones the sprite frame data from source frame to destination frame
Flips a sprite frame on the x axis
Flips a sprite frame on the y axis
Apply an effect to the sprite frame buffer
- 0: mirror the sprite horizontally (see SFXFLIP)
- 1: mirror the sprite vertically (see SFYFLIP)
- 10: Make the sprite semi transparent, by dithering, first pixel is off
- 11: Make the sprite semi transparent, by dithering, first pixel is on
See example1: Sprite Example
See example2: Sprite Example