SE3K Survivors Experience 3000

SC-3000 BASIC LEVEL III-B -- COMPLETE MANUAL

SC-3000 BASIC Level III-B — part of the SE3K documentation library, also readable inside the emulator.

============================================================================
SC-3000  BASIC LEVEL III-B  --  COMPLETE MANUAL
============================================================================

  Cartridge  : BASIC Level III-B
  CPU        : Zilog Z80A  @ 3.58 MHz
  ROM        : 32,768 bytes  ($0000-$7FFF) 
  

GENERAL INDEX

GENERAL INDEX
----------------------------------------------------------------------------

  VOL_A1_BASIC_GUIDE.txt
  +-----------------------------------------------------------------------+
  |  VOLUME A1 -- SC-3000 BASIC Guide                                     |
  |  For beginners: from power-on to graphics and sound.                  |
  |  No assembler knowledge required.                                     |
  +-----------------------------------------------------------------------+
    Ch. 1   First contact
    Ch. 2   Variables, types, operators
    Ch. 3   Flow control
    Ch. 4   Text and screen
    Ch. 5   Graphics
    Ch. 6   Sound
    Ch. 7   Input and timer
    Ch. 8   Cassette
    Ch. 9   Direct hardware access
    Ch. 10  Error table

  VOL_A2_DEMOS.txt
  +-----------------------------------------------------------------------+
  |  VOLUME A2 -- BASIC Demo Programs                                     |
  |  Ready-to-type demo programs, grouped by category. Companion to A1.   |
  +-----------------------------------------------------------------------+
    1.  Sound & music   (1.1 Ride of the Valkyries -- 4-channel sequencer)
    2.  Graphics        (2.1 Graphics tour -- every primitive)
    3.  Sprites         (3.1 Sprite playground -- sizes/motion/limits)
    4.  Input & games   (4.1 Input test, 4.2 Dodger game)
    5.  Text & screen                         [.] to write

  VOL_B_QUICK_REF.txt
  +-----------------------------------------------------------------------+
  |  VOLUME B -- BASIC Quick Reference                                    |
  |  Syntax in alphabetical order. Open and search.                       |
  +-----------------------------------------------------------------------+
    Commands (alphabetical)
    Functions (alphabetical)
    Operators and precedences
    Colour table
    SOUND frequency table
    SC-3000 ASCII codes

  VOL_C_HARDWARE.txt
  +-----------------------------------------------------------------------+
  |  VOLUME C -- Hardware Reference                                       |
  |  The three main chips and how to control them directly.               |
  |  Prerequisite: basic knowledge of Z80 machine language.               |
  +-----------------------------------------------------------------------+
    Ch. 1  SC-3000 architecture -- memory and I/O map
    Ch. 2  VDP -- TMS9918A (video processor)
    Ch. 3  PSG -- SN76489AN (sound processor)
           3.1  Overview and register map
           3.2  Tone channels (10-bit frequency divider)
           3.3  Noise channel
           3.4  Volume registers
           3.5  Writing to the PSG (BASIC SOUND/BEEP)
           3.6  Write protocol (latch/data byte format)
           3.7  LFSR and white noise (SC-3000H specific)
           3.8  Initial LFSR state
           3.9  Voltage decay and envelope simulation
           3.10 Sample playback technique
           3.11 Credits and references (Maxim, 2003)
    Ch. 4  PPI -- Intel 8255 (peripheral interface)
    Ch. 5  Joystick

  VOL_D_ML_INTERFACE.txt
  +-----------------------------------------------------------------------+
  |  VOLUME D -- Machine Language Interface                               |
  |  ROM routines callable from machine code.                             |
  |  Includes ready-to-use BASIC DATA/POKE/CALL examples.                |
  +-----------------------------------------------------------------------+
    Ch. 1   DATA/POKE/CALL convention
    Ch. 2   System table ($0100)
    Ch. 3   Utility routines ($1A20)
    Ch. 4   Output routines ($2400)
    Ch. 5   VDP/VRAM routines ($2B80)
    Ch. 6   Graphics and CMT routines ($39D0)
    Ch. 7   Keyboard and system routines ($4A00)
    Ch. 8   Hooks and RAM vectors
    Ch. 9   Program structure in memory
    Ch. 10  RAM system variable map
    Ch. 11  Cassette tape format (KCS encoding, block structure, parity)

  VOL_E1_TABLES.txt
  +-----------------------------------------------------------------------+
  |  VOLUME E1 -- Annotated Disassembly (Part 1: Tables)                  |
  |  All ROM dispatch tables with full body disassembly and cross-refs.   |
  |  Each entry includes: callers list (full ROM scan), annotated Z80.    |
  |  Reference material for reverse engineering and ML programming.       |
  +-----------------------------------------------------------------------+
    Sec. 1   Reset and interrupt vectors
    Sec. 2   System table ($0100, 26 entries)
    Sec. 3   Statement token table ($17C0)
    Sec. 4   Function token table ($1960)
    Sec. 5   Utility table ($1A20, 33 entries)
    Sec. 6   Output table ($2400, 32 entries)
    Sec. 7   VDP/VRAM table ($2B80, 28 entries)
    Sec. 8   Graphics/CMT table ($39D0, 23 entries)
    Sec. 9   BASIC statement dispatch table ($4280, 32 entries)
    Sec. 10  System/keyboard table ($4A00, 51 entries)
    Sec. 11  Extended graphics table ($5A00, 35 entries)

  VOL_E2_HANDLERS.txt
  +-----------------------------------------------------------------------+
  |  VOLUME E2 -- Annotated Disassembly (Part 2: Handlers)                |
  |  Annotated Z80 listing of all BASIC command handlers.                 |
  |  ROM version notes and unidentified symbols.                          |
  +-----------------------------------------------------------------------+
    Sec. 12  BASIC command handlers ($4280) -- annotated disassembly
    Sec. 13  ROM v1.0 / v1.1 difference notes
    Sec. 14  Unidentified symbols

  VOL_F_TUTORIAL.txt
  +-----------------------------------------------------------------------+
  |  VOLUME F -- Tutorial: Magical Labyrinth                              |
  |  A complete BASIC+ML game project built chapter by chapter.           |
  |  Prerequisites: Vol. A1 ch.9, Vol. C, Vol. D.                        |
  +-----------------------------------------------------------------------+
    Ch. 0   Memory map, course index and integration guide
    Ch. 1   VDP setup and first VRAM output
    Ch. 2   Tape loader (BINLOADER + VRAMLOADER)
    Ch. 3   Tile patterns and board rendering
    Ch. 4   Joystick and input (JOY_READ + KEY_REPEAT)
    Ch. 5   Board push and BFS reachability
    Ch. 6   Pawn sprites and complete INSERT phase
    Ch. 7   PSG sound effects (SN76489)
    Ch. 8   Game logic in BASIC
    Ch. 9   Complete FSM and greedy AI
    Ch. 10  HUD and integrated listing

  VOL_G_TAPE_MASTERING.txt
  +-----------------------------------------------------------------------+
  |  VOLUME G -- Tape Mastering: saving graphics to cassette              |
  |  BINSAVER/VRAMSAVER writers + 8x8 font generator + mastering program  |
  |  that records the graphics blocks Vol. F's loaders read back.         |
  |  Standalone tool: GRAPHICS_MASTER.txt (BASIC 10-5050) -- load alone   |
  |  and RUN to master the tape. Also: TAPE_GRAPHICS_MODULE.txt (embedded).|
  +-----------------------------------------------------------------------+
    Sec. 0b Standalone graphics master Sec. 5  The font (75 glyphs)
    Sec. 1  Tape block format          Sec. 6  Mastering workflow
    Sec. 2  ROM write routines         Sec. 7  Points to confirm on emulator
    Sec. 3  BINSAVER (RAM->tape)
    Sec. 4  VRAMSAVER (VRAM->tape)

SUGGESTED READING ORDER

SUGGESTED READING ORDER
----------------------------------------------------------------------------

  Complete beginner
    Vol. A1  ->  Vol. B (as a dictionary)

  BASIC programmer wanting to use POKE/CALL
    Vol. A1 ch. 9  ->  Vol. D ch. 1  ->  Vol. D ch. 3-7

  Understanding the hardware
    Vol. C  ->  Vol. D ch. 5-7  ->  Vol. E1  ->  Vol. E2

  Reverse engineer
    Vol. C  ->  Vol. D  ->  Vol. E1  ->  Vol. E2

  Building a complete game (hands-on project)
    Vol. A1 ch. 9  ->  Vol. C  ->  Vol. D  ->  Vol. F (chapter by chapter)

DOCUMENTATION STATUS

DOCUMENTATION STATUS
----------------------------------------------------------------------------

  Legend:  [Y] complete   [~] partial   [.] to write

  Volume A1 --  BASIC Guide              [Y] all chapters complete (1-10)
  Volume A2 --  BASIC Demos              [~] sound/music/graphics/sprites/input+games done; text to write
  Volume B  --  Quick Reference          [Y] syntax, tokens, ASCII complete
  Volume C  --  Hardware Reference       [Y] all chapters complete (1-5+3.6-3.11)
  Volume D  --  ML Interface             [Y] ML routines, DATA/POKE/CALL examples
  Volume E1 --  Disassembly (Tables)     [Y] sections 1-11, full Z80 + callers
  Volume E2 --  Disassembly (Handlers)   [Y] sections 12-14 complete
  Volume F  --  Tutorial (Game)          [Y] chapters 0-10 complete

============================================================================