Skip to content

optixx Posts

Atari 800 XL Assembler – Update

Added a new example to the repo called dli7 that creates a display list interrupt that manipulates the standard basic DL to display different background colors per textline. There is also a new python script in the repo to generate a Basic program that pokes the ML binary into memory and excutes it using USR(STARTADDRESS).
In the .asm file we ORG the binary to $4000 and in Basic we can excute it then using USR(16384).

This is the DLI asm

    run     start
    org     $4000

WSYNC       = $d40a
VCOUNT      = $d40b
COLPF2      = $d018
DL          = $cc

    lda     $0230
    sta     DL
    lda     $0231
    sta     DL+1
    lda     #<dli
    sta     $0200
    lda     #>dli
    sta     $0201

    ldy     #3
    lda     (DL),y
    eor     #128
    sta     (DL),y
    ldy     #8
    lda     (DL),y
    eor     #128
    sta     (DL),y
    cpy     #29
    bne     dlloop
    lda     #192
    sta     $d40e

    lda     #$ff
    sta     $02fc
    ldx     $02fc
    cpx     #$ff
    bne     exit
    jmp     loop

    lda     VCOUNT
    sta     WSYNC
    sta     COLPF2

Now you can assemble your code:
mads -l -t dli7.asm

And convert the .obx binary to basic program
python --filename dli7.obx --start-addr 16384 --strip-header 12

This will generate a basic file dli.bas from the .obx

20 FOR X=16384 TO 16457
40 POKE X, D
60 Z = USR(16384)
70 DATA 173,48,2,133,204,173,49,2
80 DATA 133,205,169,62,141,0,2,169
90 DATA 64,141,1,2,160,3,177,204
100 DATA 73,128,145,204,160,8,177,204
110 DATA 73,128,145,204,200,192,29,208
120 DATA 245,169,192,141,14,212,169,255
130 DATA 141,252,2,174,252,2,224,255
140 DATA 208,3,76,51,64,96,72,173
150 DATA 11,212,141,10,212,141,24,208
160 DATA 104,64

Now you can run the basic program
atari800 -pal -xl -basic -xlxe_rom ${ATARI_PATH}/roms/ATARIXL.ROM -basic_rom ${ATARI_PATH}/roms/ATARIBAS.ROM dli7.bas

Comments closed

Bildschirmtext (BTX)

Being a kid from the 80ies, i never came around using the german Bildschirmtext service. Luckily I found a recent implementation of the BTX protocol with some pages from the late 80ies and early 90ies.

Run the BTX server

brew install socat
git clone
cd bildschirmtext
python3 -m virtualenv env
source env/bin/activate
pip install -r requirements.txt
cd server
socat TCP-LISTEN:20000,reuseaddr,fork 'exec:python'

Compile and run the client

brew install sdl2
git clone
cd btx_decoder/sdl


The guest user (user 0, co-user 1) has an empty password, so you can log in as a guest by pressing “#” 3x at startup (or DCT once). You can define your own users by creating files in users/ and secrets/.

*00#: Retransmit page (in case of transmission errors)
*09#: create page again (or reload from database)
*#: return to the previous page
*page number#: navigation to a specific page
[0-9] and #: navigation to a following page
**: deletes the input
*9#: logs off the user
Comments closed

Amiga style PSP Demo

I have been working on a Amiga style PSP demo using some traditional Amiga OCS influenced demo effects. It started with porting the FC player to the PSP, later i added the sine scroller effect and logo swing.


  1. Install docker image with psp toolchain
  2. Create script into your path
  3. Compile make clean all 
  1. Run elf in the emulator
/Applications/ sine-deme.elf
Comments closed

Learning Atari 800 XL Assembler

I revisted my Atari code snippets that i collected over the last 2 years to learn Atari 800 XL assember. I created a Github repo to make it easy yo access them.

Hello World DLI

Weganoid Game


  1. Install mads assembler into your path
  2. Install atari800 emulator into your path
  3. Create helper scripts into your path to start the emulator
${ATARI_PATH}/bin/atari800 -pal -xe -xlxe_rom ${ATARI_PATH}/roms/ATARIXL.ROM -video-accel -win-width 800 -win-height 600 "$1"
  1. Build and run an example
cd hello 
make all


  • mads – MADS multi-pass crossassembler
  • atari800 – Atari800 portable and free Atari 8-bit emulator
  • sample code – Atari 800 XL code samples
Comments closed

A modern toolchain for Vectrex development

Recently i read an article about the Vectrex game console. I kew the system a bit, also played it when it came out in the early 80s at a friends house. But i never really hat a connection to the system, like i have for the SNES or the Amiga computer.

Since writing an emulator is on my programming bucketlist, i recenlty took a look at simple platforms that i could start to write an emulator for. I looked into stuff like Chip8 and the GameBoy that seemed easy to emulate, in comparison to a PS1 or N64.

So the Vectrex got interested. I started reading its specification. It all seemed straigth forward to me. The Vectrex uses a Motorola 6809 CPU, which is not a super common 8bit CPU, but was used in the Dragon home computers. Otherwise there is an AY-3-8912 for the sound and 1KB RAM and 8KB ROM.

To get started i took a look into homebrew scene, to figure out getting own code runing on the machine. As usual for systems from that time it was mainly programmed using machine code. Which i kind of like, but also implicates a higher learning curve. There is typically no middleware or frameworks that helps you with anyhting, so you have to learn all the HW registers and figure out how to stuff.

So i was surpised to find a of modern c toolchain with some libc and bios support. I ended up following the instructions for a modern c based toolchain.

The toolchain basically consists of a c compiler, assmbler & linker and a emulator. It also came with and SDL based Emulator, but it would not run on current MacOS because of the unmaintained/bugfixed SDL library. So i decided to port the the emulator to SDL2, which was fun learning the render contexts of SDL2.

So thats what iam using

  • CMOC – The C compiler
  • LWTOOLS – Assembler and linker for the 6809
  • VecX – Vectrex emulator

I started off modifying the c examples that came from Johan who ported the CMOC compiler suite to the Vectrex system.

This is what i came with, you can find the code in my sample repo.

VecX Emulator

Comments closed