Getting Started: Difference between revisions

From F256 Foenix
Jump to navigationJump to search
(→‎SD Card: typo)
 
(20 intermediate revisions by 11 users not shown)
Line 17: Line 17:
* [https://www.amazon.com/dp/B08F57GKCL Pico PSU] - You power the Pico PSU via a 12V DC center-positive Power Supply source.
* [https://www.amazon.com/dp/B08F57GKCL Pico PSU] - You power the Pico PSU via a 12V DC center-positive Power Supply source.
* [https://www.amazon.com/dp/B07MXXXBV8 12V DC center-positive A/C Adapter] - Commonly used to power the Pico PSU.
* [https://www.amazon.com/dp/B07MXXXBV8 12V DC center-positive A/C Adapter] - Commonly used to power the Pico PSU.
The board itself has no power switch. If you do not have a Mini-ITX case, a pin header on the board can be bridged by a jumper and thereby used instead of a proper power switch as a stop gap solution. In this picture https://wiki.c256foenix.com/images/6/64/Pinout_Jr_December_7th_Trans.png  the pin header in question is shown in the lower right and is labeled with ''PW ON SPST Switch''.


== Getting programs onto the F256 ==
== Getting programs onto the F256 ==
Line 25: Line 26:


* Cards should support the V2 protocol (HC or XC); older cards that only support the V1 protocol (typically 2GB or less) won't work. By contrast, the kernels for the C256 machines generally only work with V1 cards.  Note that, in both cases, this is a software limitation -- all of the Foenix machines are electrically capable of using both kinds of cards.
* Cards should support the V2 protocol (HC or XC); older cards that only support the V1 protocol (typically 2GB or less) won't work. By contrast, the kernels for the C256 machines generally only work with V1 cards.  Note that, in both cases, this is a software limitation -- all of the Foenix machines are electrically capable of using both kinds of cards.
* Cards *MUST* be formatted FAT32 -- **NOT: FAT, FAT12, FAT16, or exFAT**.  Note that while MacOS will read a FAT32 formatted card, the included disk utility won't format FAT32.  Windows 10/11 works fine, but make sure to force FAT32 (or use the command line: <code>format /FS:FAT32 H:</code>)
* Partitioning should be MBR, and partition type 0x0c.
* Cards *MUST* be formatted FAT32 -- **NOT: FAT, FAT12, FAT16, or exFAT**.   
* Formatting with Windows 10/11 works fine, but make sure to force FAT32 (or use the command line: <code>format /FS:FAT32 H:</code>)
* Formatting with MacOS will only work using the <code>diskutil</code> command line utility. An example usage looks like this: <code>sudo diskutil eraseDisk FAT32 [DiskName] MBRFormat /dev/[DiskNumber]</code>.  You can use <code>diskutil list</code> to get the disk number for the SD Card.
* Formatting and partitioning SD cards with Linux can be done using the <code>gnome-disk-utility</code> (known simply as <u>Disks</u>) and is installed on most mainstream distributions of Linux. <u>Disks</u> will access all the drives on the computer so be sure you have the SD card selected when editing. [https://wiki.gnome.org/Apps/Disks Gnome/Disks wiki]
* FAT32 only supports a maximum partition size of 32Gb, on larger cards you will need to create multiple partitions -- however, only the first is recognized by DOS.
* Some folks have had luck formatting cards with the [https://www.sdcard.org/downloads/formatter/sd-memory-card-formatter-for-windows-download/ Official SD Association formatter for Windows].
* Some folks have had luck formatting cards with the [https://www.sdcard.org/downloads/formatter/sd-memory-card-formatter-for-windows-download/ Official SD Association formatter for Windows].


Line 113: Line 119:
|}
|}


=== Memory Map under BASIC ===
=== Running PGZ Files ===
{| class="wikitable sortable"
|+ Caption text
|-
! Initial Address !! End Address !! Description !! Bytes
|-
| $0000|| -|| MMU Control Register || 1
|-
| $0001|| -|| I/O Control Register || 1
|-
| $0002|| $0007|| Free Zero Page Addresses || 6
|-
| $0008|| $000F|| MMU Control Addresses || 8
|-
| $0010|| $002F|| Free Zero Page Addresses || 32
|-
| $0030|| $003F|| Used Zero Page Addresses for (xx),Y Addressing || 16
|-
| $0040|| $0041 || Current Address on screen of start of line || 2
|-
| $0042|| $004F|| Avaliable Zero Page Addresses || 14
|-
| $0050|| $00AF|| Number / Floating Point Stack for 16 numbers || 95
|-
| $00B0||$00EF|| Available Zero Page || 63
|-
| $00F0|| $00FF|| Kernel Arguments in Zero Page || 16
|-
| $0100|| $01FF|| Hardware Stack of 6502 || 256
|-
| $0200|| $0228|| Basic mini-Kernel memory || 40
|-
| $0229|| $03FF|| Available Low Memory | Also used by Sound Command in BASIC || 470
|-
| $0400|| $041F|| Control Storage first 8 bytes control syntax highlighting || 32
|-
| $0420|| $0814|| Memory Storage || 1012
|-
| $0814|| $0FFF|| Available Low Memory || 2027
|-
| $1000|| $1FFF|| SuperBASIC Identifier Tables, allocated memory, string vars, stack || 4kb
|-
| $2000|| $77FF|| SuperBASIC Program Tokenized Code (grows Upward) || 22kb
|-
| $7800|| $7FFF|| Top 2k of SuperBASIC Program tokenize code or used for ML routines in low memory || 2kb
|-
| $8000|| $BFFF|| SUPERBASIC CODE || 16kb
|-
| $C000|| $DFFF|| I/O Memory Pages / Underlying Kernel Code (Selectable with I/O control Register)|| 8kb
|-
| $E000|| $FFEF|| KERNEL CODE || 8176
|-
| $FFF0|| $FFFF|| Reset Vectors and NMI / IRQ / BRK Vectors || 16
|-
| $01:0000|| $02:2BFF|| Default Memory used by BASIC bitmap graphics || 75kb
|-
| $02:2C00|| $02:7FFF|| Available High Memory || 21kb
|-
| $02:8000|| $02:F000|| Available High Memory | Used for BASIC Cross Development w/PC or MAC|| 32k
|-
| $03:0000|| $03:7FFF|| Used for Sprite Data in BASIC || 32kb
|-
| $03:8000|| $03:FFFF|| Available High Memory | Unless not running from Flash, Used for ROM Images|| 32k
|-
| $04:0000|| $07:DFFF|| Available High Memory || 248kb
|-
| $07:E000|| $07:FFFF|| Available High Memory | Being considered to be Reserved for Environmental Variables || 8Kb
|-
| $10:0000|| $13:FFFF|| Cartridge Expanded Memory (addresable only by CPU) || 256kb
|-
| $14:0000|| $1F:FFFF|| Future Expansions? || 768kb
|}
 
== Native Code ==
 
* Binary programs for the F256 line are typically distributed as <code>pgx</code> or <code>pgz</code> files (see [[File Formats]], they are like the <code>prg</code> format in the C64 ecosystem).
 
* SuperBASIC: Slash (<code>/</code>) command will execute the named flash resident program, such as <code>/dos</code> or <code>/help</code> (SuperBASIC reference).
 
* PGZ/X files can be run from SuperBASIC with <code>/- program.pgz</code>, and from DOS with <code>- program.pgz</code>
 
* The <code>-</code> is also referred to as <code>pexec</code>, and is a chainloader that understands <code>pgx</code> and <code>pgz</code> formats, so <code>/- program.pgz</code> first hands over control to <code>pexec</code> which then loads the program and hands over control.
 
* You will typically need to reset the machine to get back to SuperBASIC.
 
* Switch to DOS with <code>/dos</code> and back into BASIC once there with <code>basic</code>.  <code>help</code> display a list of available DOS commands.
 
Try the included native demo programs:
 
{| class="wikitable"
! Program !! Notes !! Source |
|-
| <code>wrtn0825-vcf.pgz</code> || Which Rules the Night (game) || @beethead
|-
| <code>matchit0825-vcf.pgz</code> || Match It (game) || @beethead
|-
| <code>balls.pgz</code> || Demonstrates 280 multiplexed sprites || [https://github.com/FoenixRetro/demos/blob/main/README.md GitHub]
|}
 
== More Resources ==


<pre>
/- "file.pgz"
</pre>
=== More Resources ===
=== This Wiki ===
=== This Wiki ===


Line 220: Line 131:
=== Discord ===
=== Discord ===


The [https://discord.com/invite/aAEQXZHXgM Foenix Retro Systems Discord] is the primary place to get questions answered.
The [https://discord.gg/mUfNc3dQZj Foenix Retro Systems Discord] is the primary place to get questions answered.


Also, if you resolve your question, and you didn't find the answer here on the Wiki, '''''please consider contributing to the Wiki''''', for the benefit of others with the same question!
Also, if you resolve your question, and you didn't find the answer here on the Wiki, '''''please consider contributing to the Wiki''''', for the benefit of others with the same question!

Latest revision as of 15:19, 4 October 2024

Getting Powered Up[edit | edit source]

Powering your F256K[edit | edit source]

The F256K is powered via a standard 2.5mm DC Connector, which takes a centre-positive 12V 2A capable Power Supply.

This type of power supply is quite common. Example 12V 2A capable power supply (#)

(#) This specific power supply has not been verified (by the author) for use with the F256K. Please update this page with verified options!

Powering your F256Jr[edit | edit source]

The F256Jr is supplied as a Mini-ITX form factor mainboard, with a standard 24 pin ATX power supply connector for power connectivity.

Since the F256Jr needs relatively little power, compared to a mini-ATX PC, a popular DC 12V 24pin Pico ATX PSU works well and is a compact solution.

The board itself has no power switch. If you do not have a Mini-ITX case, a pin header on the board can be bridged by a jumper and thereby used instead of a proper power switch as a stop gap solution. In this picture https://wiki.c256foenix.com/images/6/64/Pinout_Jr_December_7th_Trans.png the pin header in question is shown in the lower right and is labeled with PW ON SPST Switch.

Getting programs onto the F256[edit | edit source]

SD Card[edit | edit source]

Both the F256K and F256JR have an SD card slot. The device software to read the SD card is a bit touchy (it's inherited from the Commander X16 project) and doesn't work with all SD cards

  • Cards should support the V2 protocol (HC or XC); older cards that only support the V1 protocol (typically 2GB or less) won't work. By contrast, the kernels for the C256 machines generally only work with V1 cards. Note that, in both cases, this is a software limitation -- all of the Foenix machines are electrically capable of using both kinds of cards.
  • Partitioning should be MBR, and partition type 0x0c.
  • Cards *MUST* be formatted FAT32 -- **NOT: FAT, FAT12, FAT16, or exFAT**.
  • Formatting with Windows 10/11 works fine, but make sure to force FAT32 (or use the command line: format /FS:FAT32 H:)
  • Formatting with MacOS will only work using the diskutil command line utility. An example usage looks like this: sudo diskutil eraseDisk FAT32 [DiskName] MBRFormat /dev/[DiskNumber]. You can use diskutil list to get the disk number for the SD Card.
  • Formatting and partitioning SD cards with Linux can be done using the gnome-disk-utility (known simply as Disks) and is installed on most mainstream distributions of Linux. Disks will access all the drives on the computer so be sure you have the SD card selected when editing. Gnome/Disks wiki
  • FAT32 only supports a maximum partition size of 32Gb, on larger cards you will need to create multiple partitions -- however, only the first is recognized by DOS.
  • Some folks have had luck formatting cards with the Official SD Association formatter for Windows.

Demos Archive[edit | edit source]

Debug USB port[edit | edit source]

  • This is what most developers use as it's the most convenient. Connect the debug USB port to your PC or Mac
  • You can use:
    • FoenixMgr - works on Windows, Mac, Linux
      • A Python script to manage the Foenix series of retro style computers through their USB debug ports. This tool allows uploading files of various formats to system RAM, and displaying memory through various means.
    • FoenixIDE (Windows only)
      • Development and Debugging Suite for the C256 Foenix Family of Computers.

wget[edit | edit source]

If you have the wifi configured, you can use wget to pull programs and data right off the web!

SuperBASIC[edit | edit source]

The machine boots to SuperBASIC. SuperBASIC is inspired by BBC BASIC but offers quite a bit more.

To get started, you can type in a sample program at the command prompt:

10 for i=1 to 5
20 print "Hello world"
30 next
run

SuperBASIC is similar to CBM (Microsoft) BASIC but has some differences. For example, note in the sample above it's just next not next i.

The first 15 or so pages of the SuperBASIC Reference Manual are quite instructive.

SuperBASIC is actually much more powerful and supports structured programming (procedures, blocks etc.)

dir - Run this to display directory of SD card

Loading & running programs off of the SD card is similarly easy:

load "JrWordl.bas"
run

Similar to the C64, you can save time in loading programs from the dir listing by using your cursor keys to go up to the entry, typing load " (insert mode is active by default) etc. You can use CTRL+E to jump to the end of the line and use CTRL+K to delete any text from the cursor to the end of the line. Correctly place the closing " and hit ENTER.

CTRL+C acts as a "break" command and stops any running SuperBASIC program or LIST command.

Read built-in help/reference:

/help : But NOTE, this erases BASIC memory! Use Backspace key to go back in menus and to exit.

Explore the included demo SuperBASIC programs:

Program Notes Source
JrWordl.bas Wordle game, guess 5 letter word
mandel.bas Draws Mandlebrot set in graphics mode, takes between 2 and 3 hours @Mu0n
rpg-demo.bas UI sample that shows Zelda like RPG game. Control the character with an Atari-joystick connected to JoyPort1 @econtrerasd
Problematic_Code.bas Displays scrolling starfield
noelrl.bas Simple integer BASIC bench mark from Noel's retro lab. Completes < 3.5 seconds, compares very favourably to other retro systems! Youtube
dance.bas Animates sprite of dancer @Mu0n
luna.bas Displays simple scene
blink.bas Blinks drive access light @Mu0n
piano.bas Play some notes with the PSG @Mu0n

Running PGZ Files[edit | edit source]

/- "file.pgz"

More Resources[edit | edit source]

This Wiki[edit | edit source]

Explore all of the content of this Wiki, to expand your F256 series knowledge!

Discord[edit | edit source]

The Foenix Retro Systems Discord is the primary place to get questions answered.

Also, if you resolve your question, and you didn't find the answer here on the Wiki, please consider contributing to the Wiki, for the benefit of others with the same question!

Foenix Retro Systems Newletter[edit | edit source]

Read back issues here (also a great source for sample programs).

Issues starting at #4 cover the F256 line. Issues 1-3 cover the previous version of the hardware (C256), although there are still many salient points.