Skip to content

Commit

Permalink
Committing the working GPL'd sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Baird committed May 7, 2012
1 parent 3f5161a commit 43754d8
Show file tree
Hide file tree
Showing 30 changed files with 2,682 additions and 977 deletions.
22 changes: 16 additions & 6 deletions 6502code/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CA=ca65
LD=ld65
OBJCOPY=arm-none-eabi-objcopy

all: supermon.o figforth uchess ehbasic
all: supermon.o figforth uchess ehbasic wozmon

clean:
rm -f *.o *.lst *.bin bin nullmem
Expand All @@ -16,7 +16,7 @@ clean:
rm -f bin nullmem
echo;echo

voodoo_probably_isnt_ready: voodooloader.o
voodoo: voodooloader.o
$(CA) -o voodoo.o voodooloader.a
$(LD) -t none voodoo.o -o bin
dd if=/dev/zero bs=64k count=1 >nullmem
Expand All @@ -28,14 +28,14 @@ voodoo_probably_isnt_ready: voodooloader.o

gpascal_isnt_ready:
ca65 gpascal-mini.a
ld65 -o gpascal.bin -t none -S 50688 gpascal-mini.o
$(LD) -o gpascal.bin -t none -S 50688 gpascal-mini.o
rm -f gpascal.o
$(OBJCOPY) -I binary -O elf32-littlearm -B arm gpascal.bin gpascal.o
echo "Not working yet...";echo;echo

figforth:
$(CA) -l figforth.a
ld65 -o figforth.bin -t none -S 512 figforth.o
$(LD) -o figforth.bin -t none -S 512 figforth.o
rm -f figforth.o
dd if=/dev/zero bs=64k count=1 >nullmem
dd <figforth.bin of=nullmem bs=1 conv=notrunc seek=512
Expand All @@ -47,7 +47,7 @@ figforth:

uchess:
$(CA) -l uchess.a
ld65 -o uchess.bin -t none -S 512 uchess.o
$(LD) -o uchess.bin -t none -S 512 uchess.o
rm -f uchess.o
dd if=/dev/zero bs=64k count=1 >nullmem
dd <uchess.bin of=nullmem bs=1 conv=notrunc seek=512
Expand All @@ -57,10 +57,20 @@ uchess:

ehbasic:
$(CA) -l basic.a
ld65 -o basic.bin -t none -S 51200 basic.o
$(LD) -o basic.bin -t none -S 51200 basic.o
rm -f basic.o
dd if=/dev/zero bs=64k count=1 >nullmem
dd <basic.bin of=nullmem bs=1 conv=notrunc seek=51200
$(OBJCOPY) -I binary -O elf32-littlearm -B arm nullmem basic.o
echo "load 6502code/basic.o 0x20000000"
echo "g c800";echo;echo

wozmon:
$(CA) -l wozmon.a
$(LD) -o wozmon.bin -t none -S 61440 wozmon.o
rm -f wozmon.o
dd if=/dev/zero bs=64k count=1 >nullmem
dd <wozmon.bin of=nullmem bs=1 conv=notrunc seek=61440
$(OBJCOPY) -I binary -O elf32-littlearm -B arm nullmem wozmon.o
echo "load 6502code/wozmon.o 0x20000000"
echo "g f000";echo;echo
6 changes: 2 additions & 4 deletions 6502code/basic.a
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,6 @@ Ibuffe = Ibuffs+$47; end of input buffer
Ram_base = $0300 ; start of user RAM (set as needed, should be page aligned)
Ram_top = $C000 ; end of user RAM+1 (set as needed, should be page aligned)

; This start can be changed to suit your system

; .org $C800 ;code concludes at around $F025

; BASIC cold start entry point

; new page 2 initialisation, copy block to ccflag on
Expand Down Expand Up @@ -688,6 +684,8 @@ LAB_2E05
LDA #<LAB_SMSG ; point to sign-on message (low addr)
LDY #>LAB_SMSG ; point to sign-on message (high addr)
JSR LAB_18C3 ; print null terminated string from memory
lda #$4C
sta LAB_WARM
LDA #<LAB_1274 ; warm start vector low byte
LDY #>LAB_1274 ; warm start vector high byte
STA Wrmjpl ; save warm start vector low byte
Expand Down
6 changes: 1 addition & 5 deletions 6502code/figforth.a
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
;;; -*- mode: asm -*-
;;; FIG-FORTH is in the Public Domain.

;;; Remember the 1980s? When people charged you up to $400 (in 1980s
;;; dollars!) to compensate their Hard Work at editing maybe ~200
;;; lines of existing source code?
; XEMIT, XKEY, XQTER, XCR, AND RSLW

.setcpu "6502"
.feature labels_without_colons
Expand Down
12 changes: 5 additions & 7 deletions 6502code/supermon.a
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
;;; -*- asm -*-
;;; SuperMON - by Jim Butterfield.
.feature labels_without_colons
;;;
;;; Believed to be free to distribute and modify, as this was
;;; happening with Jim's permission while he was alive.
;;; SuperMON 64
;;;
;;; Modified to suit the stm6502 simulator by Chris Baird
;;; <[email protected]> May 2012

.feature labels_without_colons
;;; Original source code courtesy Jim Butterfield
;;;
;;; load/save routines removed..

pch = $01 ;these must remain in order
pcl = $02
Expand Down
4 changes: 2 additions & 2 deletions 6502code/uchess.a
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
; Additional code by Lee Davidson, Darryl Richter and Ken Wessen
; Source formatted for KRUSADER - the Replica 1 Assembler

; modified for the SYM1 and the ca65 crossassembler --cjb20100909
; ca65 symuchess.asm && ld65 -t none symuchess.o && mv a.out symchess.bin
;;; modified for the SYM1 and the ca65 crossassembler --cjb20100909
;;; ca65 symuchess.asm && ld65 -t none symuchess.o && mv a.out symchess.bin

.feature labels_without_colons

Expand Down
152 changes: 152 additions & 0 deletions 6502code/voodooloader.a
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
;;; -*- asm -*-

GAME = 32592
SERIALPORT = $FFF0
CUR_OUT_DEV = $BA

.org $F000

RESET: sei
cld
ldx #$FF
txs

lda #3
sta CUR_OUT_DEV
lda #80
sta $75E0 ;adventure engine screen width

inx
loop: lda patchtable,x
beq gogame
tay
inx
lda patchtable,x
sta $ff00,y
inx
lda patchtable,x
sta $ff01,y
inx
lda patchtable,x
sta $ff02,y
inx
bne loop

gogame: jmp GAME

;;; ----------------------------------------------------------------------

NULL: rts

CHROUT: pha
;; check what the output device currently is..
lda CUR_OUT_DEV
cmp #3
bne chro1
pla
pha
;; convert petscii to ascii
and #127
cmp #'a'
bcc out1
sbc #32
bne doout
out1: cmp #'Z'
bcs out2
cmp #'A'
bcc out2
adc #31
bne doout
out2: cmp #127
bne doout
lda #$63

doout: sta SERIALPORT
chro1: pla
rts

GETIN: lda SERIALPORT
rts

;;; this sets the default output device for CHROUT; ignore everything
;;; when .X isn't 3 (the screen). The Adams Adventure games also open
;;; the rs232 device to a Votrax type and talk

CHKOUT: stx CUR_OUT_DEV
rts


;;; ----------------------------------------------------------------------

NONMI: lda #'N'
sta SERIALPORT
lda #'M'
sta SERIALPORT
lda #'I'
sta SERIALPORT
hang: jmp hang

DOBRK: pha
txa
pha
tya
pha
tsx
lda $0104,x ;look in status to see if BRK flag set
and #%00010000
beq isbrk

isirq:
lda #'I'
sta SERIALPORT
lda #'R'
sta SERIALPORT
lda #'Q'
sta SERIALPORT

pla
tay
pla
tax
pla
rti
;bne hang

isbrk: lda #'B'
sta SERIALPORT
lda #'R'
sta SERIALPORT
lda #'K'
sta SERIALPORT
bne hang

;;; ----------------------------------------------------------------------

patchtable:
.byte $BA ;$FFBA = SETLFS
jmp NULL
.byte $BD ;$FFBD = SETNAM
jmp NULL
.byte $C0 ;$FFC0 = OPEN
jmp NULL
.byte $C9 ;$FFC9 = CHKOUT
jmp CHKOUT
.byte $D2 ;$FFD2 = CHROUT
jmp CHROUT
.byte $D5 ;$FFD5 = LOAD
jmp NULL
.byte $D8 ;$FFD8 = SAVE
jmp NULL
.byte $E4 ;$FFE4 = GETIN
jmp GETIN
.byte 0

;;; ----------------------------------------------------------------------

.org $FFFA

.word NONMI
.word RESET
.word DOBRK

;;; ----------------------------------------------------------------------
Loading

0 comments on commit 43754d8

Please sign in to comment.