aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Edwards <44756673+KevEdwards@users.noreply.github.com>2019-04-04 20:55:40 +0100
committerGitHub <noreply@github.com>2019-04-04 20:55:40 +0100
commit4f2c08b378027f3a0182488d8cbb0c376203c9cb (patch)
tree40df105adb81ddea7f00566d3e1ba8f4d8cf4a29
downloadGalaforce1Electron-4f2c08b378027f3a0182488d8cbb0c376203c9cb.tar.gz
Galaforce1Electron-4f2c08b378027f3a0182488d8cbb0c376203c9cb.tar.bz2
Galaforce1Electron-4f2c08b378027f3a0182488d8cbb0c376203c9cb.zip
Add files via uploadHEADmaster
-rw-r--r--G1_BLANK.SSDbin0 -> 2560 bytes
-rw-r--r--Master.mak74
-rw-r--r--Prebuild.mak10
-rw-r--r--README.md50
-rw-r--r--bas_extra/ELKENV1.bas.txt17
-rw-r--r--make.bat7
-rw-r--r--object/O.DIGITSbin0 -> 512 bytes
-rw-r--r--object/O.GRAPHICbin0 -> 2640 bytes
-rw-r--r--object/O.SPFONTbin0 -> 205 bytes
-rw-r--r--screenshot.pngbin0 -> 9600 bytes
-rw-r--r--src/ABSWORK.asm105
-rw-r--r--src/ALIENS1.asm98
-rw-r--r--src/ALIENS2.asm114
-rw-r--r--src/ALIENS3.asm161
-rw-r--r--src/ALIENS4.asm109
-rw-r--r--src/BOMBS1.asm138
-rw-r--r--src/BOMBS2.asm156
-rw-r--r--src/CHARP.asm249
-rw-r--r--src/CONST.asm37
-rw-r--r--src/CYCLE.asm82
-rw-r--r--src/DOWN.asm89
-rw-r--r--src/FLAGS.asm68
-rw-r--r--src/HIGH.asm190
-rw-r--r--src/INIT.asm244
-rw-r--r--src/MUSIC1.asm158
-rw-r--r--src/MUSIC2.asm147
-rw-r--r--src/MUSIC3.asm69
-rw-r--r--src/PATDAT.asm368
-rw-r--r--src/PATT.asm486
-rw-r--r--src/ROUT1.asm217
-rw-r--r--src/ROUT2.asm177
-rw-r--r--src/ROUT3.asm261
-rw-r--r--src/ROUT4.asm100
-rw-r--r--src/SPRITES.asm108
-rw-r--r--src/STARS.asm81
-rw-r--r--src/TITLE.asm83
-rw-r--r--src/VECTORS.asm210
-rw-r--r--src/WAVE.asm85
-rw-r--r--src/ZPWORK.asm64
39 files changed, 4612 insertions, 0 deletions
diff --git a/G1_BLANK.SSD b/G1_BLANK.SSD
new file mode 100644
index 0000000..62be5dc
--- /dev/null
+++ b/G1_BLANK.SSD
Binary files differ
diff --git a/Master.mak b/Master.mak
new file mode 100644
index 0000000..c3ee197
--- /dev/null
+++ b/Master.mak
@@ -0,0 +1,74 @@
+\\
+\\ Galaforce 1 Electron
+\\
+\\ (C) Kevin Edwards 1986-2019
+\\
+
+objstrt% =&E00 \ Start of main code, however, data is loaded below this later which is downloaded to other parts of memory ( to &700 and &A00 - see DOWN.asm )
+codeend% =&2F00 \ End of memory available for code ( graphics are loaded above this area )
+objend% =&3A00 \ End of code/graphics, where the Downloader is positioned
+objexec% =&4800 \ Execution address when loaded to &1900 rather than &900 ( objend% + &1900 - &e00 + &300 )
+
+ INCLUDE "src\CONST.asm"
+ INCLUDE "src\ZPWORK.asm"
+ INCLUDE "src\ABSWORK.asm"
+
+ \\ Normal ASCII
+ MAPCHAR ' ','Z', 32
+
+ ORG objstrt% - &300
+ INCBIN "object\O.SPFONT"
+
+ ORG objstrt% - &200
+ INCBIN "object\O.DIGITS"
+
+ \\ Main Code block - source files assembled in the same order as the original
+ ORG objstrt%
+ INCLUDE "src\SPRITES.asm"
+ INCLUDE "src\INIT.asm"
+ INCLUDE "src\ALIENS1.asm"
+ INCLUDE "src\ALIENS2.asm"
+ INCLUDE "src\ALIENS3.asm"
+ INCLUDE "src\ALIENS4.asm"
+ INCLUDE "src\ROUT1.asm"
+ INCLUDE "src\ROUT2.asm"
+ INCLUDE "src\ROUT3.asm"
+ INCLUDE "src\ROUT4.asm"
+ INCLUDE "src\STARS.asm"
+ INCLUDE "src\BOMBS1.asm"
+ INCLUDE "src\BOMBS2.asm"
+ INCLUDE "src\CHARP.asm"
+ INCLUDE "src\FLAGS.asm"
+ INCLUDE "src\TITLE.asm"
+ INCLUDE "src\CYCLE.asm"
+ INCLUDE "src\HIGH.asm"
+ INCLUDE "src\MUSIC1.asm"
+ INCLUDE "src\MUSIC2.asm"
+ INCLUDE "src\MUSIC3.asm"
+ INCLUDE "src\WAVE.asm"
+ INCLUDE "src\PATT.asm"
+ INCLUDE "src\PATDAT.asm"
+ INCLUDE "src\VECTORS.asm"
+
+ objcodeend = P%
+ PRINT"Code start = ",~objstrt%
+ PRINT"End of code = ",~objcodeend-1
+ PRINT"Length = ",~objcodeend-objstrt%," (",objcodeend-objstrt%,") bytes"
+ PRINT"Bytes left = ",~codeend%-objcodeend," (",codeend%-objcodeend,") bytes"
+
+ \\ Include the graphics object file after the code ( From &2F00 to &394F )
+ ORG codeend%
+ INCBIN "object\O.GRAPHIC"
+
+ \\ Include the Downloader binary at its GENUINE load address
+ ORG objend%
+ INCBIN "O.DOWN"
+
+ \\ SAVE out everything
+ PRINT "Saving GAME ", ~objstrt% - &300, ~objend% + &200, ~objexec%, ~&1900
+ SAVE "GAME", objstrt% - &300, objend% + &200, objexec%, &1900
+
+ \\ Save Main Basic Loader ( gets tokenised first )
+ PUTBASIC "bas_extra\ELKENV1.bas.txt","$.L"
+
+ \ No newline at end of file
diff --git a/Prebuild.mak b/Prebuild.mak
new file mode 100644
index 0000000..f5f8c5c
--- /dev/null
+++ b/Prebuild.mak
@@ -0,0 +1,10 @@
+
+\\ Galaforce 1 Electron Prebuild process
+
+ \\ Build LoadGam - this is the code responsible for loading the main game code
+ INCLUDE "src\DOWN.asm"
+
+ \\ Save to local PC folder - this will be pushed to the final disk image when the 'master.6502' build step runs
+ PRINT"Saving O.DOWN", ~downaddr, ~P%
+ SAVE "O.DOWN", downaddr, P%
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e1f79a1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,50 @@
+# Galaforce ( Acorn Electron )
+
+**Version V1.00**
+
+(c) Kevin Edwards 1985-2019
+
+![Screenshot](screenshot.png)
+
+In 1985 I began writing a shoot-em-up game for the BBC Micro and Electron home computers. This game was published by Superior Software in 1986 under the name Galaforce.
+
+The game is written entirely in 6502 assembly language. The target computers had only 32K bytes of RAM. Of which 20K bytes was required for the video memory ( BBC Micro ) and 10K bytes on the Electron.
+
+Over 30 years have passed and I have decided to preserve this code for the future by making it public.
+
+Originally, the BBC BASIC in-line assembler was used to build the code. However, I decided to make the codebase assemble using 'beebasm' on a PC. This required me to re-work the original source code. This involved de-tokenizing all of the BBC BASIC files and adapting the code to use beebasm friendly directives / commands. This now allows Visual Code or other IDEs to be used to build the code in a nice development environment.
+
+The code here is for the Acorn Electron version of the game. I had slightly different code for the BBC Micro version - this is also shared on GitHub.
+
+The Electron version differs from the BBC Micro in the following ways:-
+
+* Uses screen MODE 5 ( 4-colours ) instead of MODE 2 ( 16-colours ) for performance reasons
+* Only one sound channel from the BBC Micro version is present for music ( melody )
+* Support for Plus 1 and First Byte Joysticks
+
+I hope it is useful to people who have an interest in 6502 assembly language programming and to those who wish to know how games were made in the 1980s.
+
+
+# Build Tools required ( PC )
+
+To build the game you first need to install the following tools:-
+
+* [beebasm](https://github.com/stardot/beebasm)
+
+
+# Build Steps ( PC )
+
+Run 'make.bat' from a command prompt whilst in the project's root folder. This will assemble the code and output 'Galaforce1Electron.ssd' in the same folder. This disk image file can be loaded by many different BBC Micro Emulators, including B-em and BeebEm. The 'beebasm' folder needs to be in your PATH environment variable, if it isn't already.
+
+You will notice that the Electron version runs very fast on a BBC Micro. This is because the sprites can be drawn much faster in MODE 5 compared with MODE 2.
+
+Alternatively, you could use 'Visual Studio Code' with the 'Beeb VSC' extension. I hope to include the required workspace and .json files required to do this.
+
+
+# Additional Notes
+
+You can find me on Twitter @KevEdwardsRetro where I ramble on about all kinds of retro computer and video game things. Please drop by and say hello.
+
+Many thanks to Rich Talbot-Watkins for his great work on BeebAsm.
+
+Thank you for reading this far.
diff --git a/bas_extra/ELKENV1.bas.txt b/bas_extra/ELKENV1.bas.txt
new file mode 100644
index 0000000..cc12c13
--- /dev/null
+++ b/bas_extra/ELKENV1.bas.txt
@@ -0,0 +1,17 @@
+ 0REM SAVE":2.ELKENV1"
+ 10REM Elk Envelopes 1/5/86
+ 20REM
+ 30*FX 12,2
+ 40
+ 50 ENVELOPE 1,1,-2,0,0,255,0,0,126,0,0,-126,126,126:REM Exploding Alien
+ 60 ENVELOPE 2,1,-2,2,0,20,20,0,126,0,0,-126,126,126:REM Firing Sound
+ 70 ENVELOPE 3,3,+12,+16,-28,1,1,1,126,0,0,-126,126,126:REM Last man
+ 80
+ 90REM Tune Envelopes
+ 100
+ 110 ENVELOPE 4,2,+1,-1,+1,2,4,2,126,0,0,-126,126,126
+ 120 ENVELOPE 5,2,+1,-1,+1,2,4,2,126,0,0,-126,126,126
+ 130 ENVELOPE 6,0,0,0,0,0,0,0,126,0,0,-126,126,126
+ 140 ENVELOPE 7,5,0,-1,0,7,255,0,126,0,0,-126,126,126
+ 150 ENVELOPE 8,3,+20,0,-1,1,7,255,126,0,0,-126,126,126
+ 160 *RUN GAME
diff --git a/make.bat b/make.bat
new file mode 100644
index 0000000..6c3ca52
--- /dev/null
+++ b/make.bat
@@ -0,0 +1,7 @@
+cls
+
+beebasm -i Prebuild.mak
+
+beebasm -i Master.mak -di G1_BLANK.ssd -do Galaforce1Electron.ssd
+@Echo. Done! .ssd image has been built
+dir *.ssd
diff --git a/object/O.DIGITS b/object/O.DIGITS
new file mode 100644
index 0000000..2cc4a76
--- /dev/null
+++ b/object/O.DIGITS
Binary files differ
diff --git a/object/O.GRAPHIC b/object/O.GRAPHIC
new file mode 100644
index 0000000..dcbbe6f
--- /dev/null
+++ b/object/O.GRAPHIC
Binary files differ
diff --git a/object/O.SPFONT b/object/O.SPFONT
new file mode 100644
index 0000000..3d535e6
--- /dev/null
+++ b/object/O.SPFONT
Binary files differ
diff --git a/screenshot.png b/screenshot.png
new file mode 100644
index 0000000..4c7d5d1
--- /dev/null
+++ b/screenshot.png
Binary files differ
diff --git a/src/ABSWORK.asm b/src/ABSWORK.asm
new file mode 100644
index 0000000..b17e183
--- /dev/null
+++ b/src/ABSWORK.asm
@@ -0,0 +1,105 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"ABSWORK"
+\\ P%=&400:ST%=P%:O%=&3000
+\\ [OPT 6
+
+\\ Map normal ASCII
+MAPCHAR ' ','Z', 32
+
+ORG &400
+
+.alst SKIP maxaliens
+.algra SKIP maxaliens
+.alpatlow SKIP maxaliens
+.alpathigh SKIP maxaliens
+.alpatoff SKIP maxaliens
+.alcount SKIP maxaliens
+.almult SKIP maxaliens
+.aldirect SKIP maxaliens
+.alx SKIP maxaliens
+.aly SKIP maxaliens
+.al_loop_count SKIP maxaliens
+.al_loop_start SKIP maxaliens
+.alpatreflect SKIP maxaliens
+
+.mybullx SKIP mymaxbull
+.mybully SKIP mymaxbull
+.mybullst SKIP mymaxbull
+
+.albullx SKIP almaxbull
+.albully SKIP almaxbull
+.albullst SKIP almaxbull
+.albullspeed SKIP almaxbull
+
+.lives EQUB 0
+.myx EQUB 0
+.myy EQUB 0
+.myst EQUB 0
+.score_base
+.myscore SKIP 8
+.hiscore SKIP 7
+
+.wavoff EQUB 0
+.almove EQUB 0
+.curwave EQUB 0
+.procst EQUB 0
+.mybullact EQUB 0
+.albullact EQUB 0
+.initact EQUB 0
+.bombdel EQUB 0
+
+.sound_flag EQUB 0
+.key_joy_flag EQUB 0
+.demo_flag EQUB 0
+.demo_count EQUB 0
+.demo_direction EQUB 0
+.counter_sound EQUB 0
+.extra_life_flag EQUB 0
+.sixteen_flag EQUB 0
+.pause_flag EQUB 0
+
+.dummy EQUB 0
+.wtflg EQUB 0
+.demsect EQUB 0
+
+.alfx EQUB 0
+.alfx2 EQUB 0
+
+.hstxt
+ EQUS"1234567890"
+ EQUS"1234567890"
+ EQUS"1234567890"
+ EQUS"1234567890"
+ EQUS"1234567890"
+ EQUS"1234567890"
+ EQUS"1234567890"
+ EQUS"1234567890"
+.hsnum
+ EQUS"1234567"
+ EQUS"1234567"
+ EQUS"1234567"
+ EQUS"1234567"
+ EQUS"1234567"
+ EQUS"1234567"
+ EQUS"1234567"
+ EQUS"1234567"
+
+.joytype EQUB 0
+.joyval EQUB 0:EQUB 0
+
+\\ ]
+\\ PRINT"General workspace from &";~ST%;" to &";~P%-1
+
+\\ PAGE=PG%
+\\ RETURN
+
+\\ DEFFNres(gap%)
+\\ P%=P%+gap%:O%=O%+gap%
+\\ =6
diff --git a/src/ALIENS1.asm b/src/ALIENS1.asm
new file mode 100644
index 0000000..5e5e38a
--- /dev/null
+++ b/src/ALIENS1.asm
@@ -0,0 +1,98 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"ALIENS1"
+\\ B%=P%
+\\ [OPT pass
+
+.init_new_aliens
+ LDAmyst:BPLinit_new_al2
+ RTS
+
+.init_new_al2
+
+ LDAinitact:ORAalmove
+ ORAalbullact:BNEalien1
+ LDYwavoff:BNEinital1
+ LDA(wavbase),Y:STAaliens
+ STYprocst:\ start alien=0 !!!
+ SEC:SBC#1
+ STAaliensm1
+ INCwavoff:INY
+
+.inital1
+ INCwavoff
+ LDA(wavbase),Y:BPLalien2
+ JSRflagson
+ INCcurwave
+ LDA#0:STAsixteen_flag
+ JSRflagson
+ BITdemo_flag:BMIintsd
+ LDY#5
+ LDAcurwave:BEQntzone16
+ AND#&F:BNEntzone16
+ LDY#25
+.ntzone16
+ JSRStartTune
+.intsd
+ SEC:RORwtflg
+ JSRmessage_loop
+ LDAcurwave
+ AND#15:TAY:\ wrap around !!!
+ LDX#0:STXwavoff
+ LDAvecwavl,Y:STAwavbase
+ LDAvecwavh,Y:STAwavbase+1
+.alien1
+ RTS
+
+.alien2
+ CMP#45:BNEspecial
+ LDX#33:STXaliens
+ DEX:STXaliensm1
+.special
+ TAY
+ LDAvecpatl,Y:STAtemp1
+ LDAvecpath,Y:STAtemp1+1
+ LDY#0
+ LDA(temp1),Y:STAtemp2:INY
+.alien4
+ LDX#0
+.alien5
+ LDAinitst,X:BPLalien6
+ INX:CPX#maxpatt:BNEalien5
+ BEQprocess_aliens
+.alien6
+ LDA(temp1),Y:BPLnormal_process
+ AND#&7F:BPLalien2
+.normal_process
+ INY
+ STAinitx,X
+ LDA(temp1),Y:INY
+ STAinity,X
+ LDA(temp1),Y:INY
+ STAinitdel,X
+ STAinitcount,X
+ LDA(temp1),Y:INY
+ STAinitnum,X
+ LDA(temp1),Y:INY
+ STAinitrelx,X
+ LDA(temp1),Y:INY
+ STAinitrely,X
+ LDA(temp1),Y:INY
+ STAinitgra,X
+ LDA(temp1),Y:INY
+ STAinitpnum,X
+ LDA#&80:STAinitst,X
+ INCinitact
+ DECtemp2:BNEalien4
+ RTS
+
+\\ ]
+\\ PRINT"Aliens 1 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/ALIENS2.asm b/src/ALIENS2.asm
new file mode 100644
index 0000000..e020558
--- /dev/null
+++ b/src/ALIENS2.asm
@@ -0,0 +1,114 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"ALIENS2"
+\\ B%=P%
+\\ [OPT pass
+
+.process_aliens
+ LDAmyst:BPLprocess_ok
+ LDX#2*process:JMPsdel
+
+.process_ok
+ LDX#maxpatt-1
+.proc1
+ LDAinitst,X:BPLproc2
+ LDAinitcount,X
+ BEQproc6
+ DECinitcount,X
+.proc2
+ DEX:BPLproc1
+ RTS
+
+.proc6
+ LDAinitdel,X:STAinitcount,X
+ LDYaliensm1
+.proc3
+ LDAalst,Y:BPLproc4
+ DEY:BPLproc3
+ BMIproc2:\ MIGHT PUT ALIENS OUT OF SYNC.
+.proc4
+ LDA#0:STAalpatoff,Y
+ STAalmult,Y
+ LDA#&80:STAalst,Y
+ LDAinitx,X:STAalx,Y
+ PHA
+ LDAinity,X:STAaly,Y
+ LDAinitgra,X:STAalgra,Y
+ STAtemp3
+ SEC:SBC#12:LSRA
+ STXtemp2+1
+ TAX
+ LDAalien_hits,X:STAalcount,Y
+ LDXtemp2+1
+ LDAinitpnum,X
+ STAalpatreflect,Y
+ AND#&7F:TAX
+ LDAvecpatdl,X:STAalpatlow,Y
+ LDAvecpatdh,X:STAalpathigh,Y
+ PLA:TAX
+ JSRrand:AND#31
+ CPX#78:BEQalter_start_x
+ CPX#79:BNEuse_original_x
+ ADC#40
+.alter_start_x
+ STAalx,Y
+.use_original_x
+ LDXtemp2+1
+ INCalmove
+ DECinitnum,X:BNEproc5
+ LDA#0:STAinitst,X
+ DECinitact
+.proc5
+ CLC:LDAinitx,X
+ ADCinitrelx,X
+.chk_xinit_wrap
+ CMP#80:BCCno_initx_wrap
+ SBC#80:JMPchk_xinit_wrap
+.no_initx_wrap
+ STAinitx,X
+ CLC:LDAinity,X
+ ADCinitrely,X:STAinity,X
+
+ LDXalx,Y:LDAaly,Y:TAY
+ STXalfx:STXalfx2
+ JSRalien_on_off
+ LDXtemp2+1
+ JMPproc2
+
+.alien_on_off
+ JSRxycalc
+ STAscreen+1:STXscreen
+ LDA#alheight:STAtemp1+1
+ LDA#&C0:STAscreen2+1
+ LDYtemp3
+ JSRsus_algra
+ JMPsprite
+
+.sus_algra
+ LSRalfx:BCCsual2
+ LDAgraph+40,Y:PHA
+ LDAgraph+41,Y:STAtemp1
+ JMPsual3
+.sual2
+ LDAgraph,Y:PHA
+ LDAgraph+1,Y:STAtemp1
+.sual3
+ LSRalfx2:BCCsual4
+ LDXgraph+40,Y
+ LDAgraph+41,Y
+ TAY:PLA:RTS
+.sual4
+ LDXgraph,Y
+ LDAgraph+1,Y
+ TAY:PLA:RTS
+
+\\ ]
+\\ PRINT"Aliens 2 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/ALIENS3.asm b/src/ALIENS3.asm
new file mode 100644
index 0000000..f9f3941
--- /dev/null
+++ b/src/ALIENS3.asm
@@ -0,0 +1,161 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"ALIENS3"
+\\ B%=P%
+\\ [OPT pass
+
+.move_the_aliens
+ LDA#process:STAtemp4
+ LDXprocst
+.move_aliens
+ LDAalst,X:BMImove2
+ JSRdelay
+.move5
+ INCprocst:LDXprocst
+ CPXaliens:BNEmove3
+ JSRprocess_aliens
+ JSRpause
+ LDX#0:STXprocst
+ INCexpldelay
+.move3
+ DECtemp4:BNEmove_aliens
+ RTS
+
+.move2
+ LSRA:BCCmove7
+ JSRexplosion:JMPmove5
+.move7
+ LDAalmult,X:BNEmove4
+ LDAalpatlow,X:STAtemp2
+ LDAalpathigh,X:STAtemp2+1
+ LDYalpatoff,X
+ INCalpatoff,X
+ LDA(temp2),Y
+ BMIbranch_wont_reach
+ JMPmove6
+.branch_wont_reach
+ AND#&7F:STAalmult,X
+ INY:INCalpatoff,X
+ LDA(temp2),Y
+ LDYalpatreflect,X
+ BPLnot_reverse
+ CMP#48:BCSflip_acute_angle
+ TAY
+ AND#&F8:STAtemp1
+ TYA:AND#7:TAY
+ LDAflip_table,Y
+ ORAtemp1
+.flip_acute_angle
+ EOR#7
+.not_reverse
+ STAaldirect,X
+
+.move4
+ LDAalx,X:LDYaly,X:TAX
+ STAalfx
+ JSRxycalc
+ STAscreen+1:STXscreen
+ LDXprocst:DECalmult,X
+ LDYaldirect,X
+ CPY#&40:BCCmoving_alien
+ JSRdelay
+ JMPmove5
+
+.moving_alien
+ CLC:LDAalx,X
+ ADCaddrelx,Y
+.check_x_wrap
+ CMP#80:BCCx_not_wrapped
+ SBC#80:JMPcheck_x_wrap
+.x_not_wrapped
+ STAalx,X
+ STAalfx2
+ CLC:LDAaly,X
+ ADCaddrely,Y:STAaly,X
+ TAY:LDAalx,X
+.dalg
+ TAX
+ JSRxycalc
+ STAscreen2+1:STXscreen2
+ LDA#alheight:STAtemp1+1
+ LDXprocst
+ LDYalgra,X
+ JSRsus_algra
+ JSRsprite
+ JMPmove5
+
+.move6
+ INY:STYtemp3+1:TAY
+ LDAactiontab,Y:STAtemp1
+ LDAactiontab+1,Y:STAtemp1+1
+ LDYtemp3+1
+ JMP(temp1)
+
+.explosion
+ LDAexpldelay:AND#1:BNEexpl4
+ LDAalx,X:LDYaly,X:TAX
+ STAalfx:STAalfx2
+ JSRxycalc
+ STAscreen+1:STXscreen
+ STAscreen2+1:STXscreen2
+ LDA#alheight:STAtemp1+1
+ LDXprocst
+ LDYalgra,X
+ LSRalfx:BCCepx1
+ LDAgraph+40+1,Y:STAtemp1
+ LDAgraph+40,Y:STAtemp3
+ JMPepx2
+.epx1
+ LDAgraph+1,Y:STAtemp1
+ LDAgraph,Y:STAtemp3
+.epx2
+ CPY#12:BCCexpl2
+ LDA#0:STAalgra,X:TAY
+ BEQexpl3
+.expl2
+ INY:INY
+ TYA:STAalgra,X
+ CPY#12:BCCexpl3
+ LDA#&C0:STAscreen2+1
+ LDA#0:STAalst,X
+ DECalmove
+.expl3
+ LSRalfx2:BCCepx3
+ LDXgraph+40,Y
+ LDAgraph+40+1,Y:TAY
+ JMPepx4
+.epx3
+ LDXgraph,Y
+ LDAgraph+1,Y:TAY
+.epx4
+ LDAtemp3
+ JMPsprite
+.expl4
+ RTS
+
+
+\ Flip table for reverse patterns
+\ Values EORed because of EOR#7
+\ which is used after to flip
+\ the acute angled 'climbs'.
+
+.flip_table
+ EQUB 0 EOR 7
+ EQUB 3 EOR 7
+ EQUB 2 EOR 7
+ EQUB 1 EOR 7
+ EQUB 7 EOR 7
+ EQUB 6 EOR 7
+ EQUB 5 EOR 7
+ EQUB 4 EOR 7
+
+\\ ]
+\\ PRINT"Aliens 3 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/ALIENS4.asm b/src/ALIENS4.asm
new file mode 100644
index 0000000..1405f1b
--- /dev/null
+++ b/src/ALIENS4.asm
@@ -0,0 +1,109 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"ALIENS4"
+\\ B%=P%
+\\ [OPT pass
+
+.actiontab
+ EQUW dat_loop
+ EQUW dat_newpat
+ EQUW dat_newalien
+ EQUW dat_die
+ EQUW dat_dropbomb
+ EQUW dat_for_loop
+ EQUW dat_next
+ EQUW mve
+
+.dat_loop
+ INCalpatoff,X:LDA(temp2),Y
+ STAalpatoff,X
+ JMPmove7
+
+.dat_newpat
+ INCalpatoff,X:LDA(temp2),Y
+ TAY
+ LDAvecpatdl,Y:STAalpatlow,X
+ LDAvecpatdh,Y:STAalpathigh,X
+ LDA#0:STAalpatoff,X
+ JMPmove7
+
+.dat_newalien
+ INCalpatoff,X:LDA(temp2),Y
+ STAtemp1
+ LDYaliensm1
+.dat_newal2
+ LDAalst,Y:BPLdat_newal3
+ DEY:BPLdat_newal2
+ BMIdat_newal4
+
+.dat_newal3
+ LDA#&80:STAalst,Y
+ ASLA:STAalmult,Y
+ STAalpatoff,Y
+ JSRrand:AND#2:STAtemp1+1
+ CLC:ADC#12
+ STAalgra,Y:STAtemp3
+ LDAalpatreflect,X:STAalpatreflect,Y
+ LDAalx,X:PHA:STAalx,Y
+ LDAaly,X:ADC#8:STAaly,Y:PHA
+ LDXtemp1
+ LDAvecpatdl,X:STAalpatlow,Y
+ LDAvecpatdh,X:STAalpathigh,Y
+ LDAtemp1+1:LSRA:TAX
+ LDAalien_hits,X:STAalcount,Y
+ PLA:TAY
+ PLA:TAX
+ STXalfx:STXalfx2
+ INCalmove
+ JSRalien_on_off
+ LDXprocst
+.dat_newal4
+ JMPmove5
+
+.dat_die
+ LDAalst,X
+ ORA#1:STAalst,X
+ JMPmove5
+
+.dat_dropbomb
+ JSRrand:AND#3:BNEnot_allowed
+ JSRinit_bomb
+ LDXprocst
+.not_allowed
+ JMPmove7
+
+.dat_for_loop
+ INCalpatoff,X:LDA(temp2),Y
+ STAal_loop_count,X
+ INY:TYA:STAal_loop_start,X
+ JMPmove7
+
+.dat_next
+ DECal_loop_count,X
+ BMIend_of_loop
+ LDAal_loop_start,X
+ STAalpatoff,X
+.end_of_loop
+ JMPmove7
+
+.mve
+ LDAalx,X:LDYaly,X:TAX
+ STAalfx
+ JSRxycalc
+ STAscreen+1:STXscreen
+ LDXprocst
+ LDA#72:STAaly,X:TAY
+ LDA#0:STAalx,X
+ STAalfx2
+ JMPdalg
+
+\\ ]
+\\ PRINT"Aliens 4 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/BOMBS1.asm b/src/BOMBS1.asm
new file mode 100644
index 0000000..895a03a
--- /dev/null
+++ b/src/BOMBS1.asm
@@ -0,0 +1,138 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"BOMBS1"
+\\ B%=P%
+\\ [OPT pass
+
+.process_my_bombs
+ LDAbombdel:BEQprocmybmb
+ DECbombdel
+.procmybmb
+ LDAmybullact:BEQbomb10
+ LDX#mymaxbull-1
+.bomb6
+ STXtemp2
+ LDAmybullst,X:BMIbomb7
+.bomb9
+ LDXtemp2
+ DEX:BPLbomb6
+ BMIbomb5
+
+.bomb7
+ LDYmybully,X
+ LDAmybullx,X:TAX
+ JSRmove_bomb
+ LDXtemp2
+ LDAmybully,X
+ SEC:SBC#8:STAmybully,X
+ BNEbomb8
+ DECmybullact
+ LDA#0:STAmybullst,X
+ BEQbomb9
+.bomb8
+ TAY
+ LDAmybullx,X:TAX
+ JSRmove_bomb
+ JMPbomb9
+
+.bomb5
+ LDAmybullact
+.bomb10
+ CMP#mymaxbull:BEQbomb1
+ LDAmyst:BMIbomb1
+ LDAdemo_flag:BMIbomb11
+ BITkey_joy_flag
+ BMIkbd_fire
+
+ BITjoytype:BPLusepl1
+ LDA&FCC0:AND#&10:BEQbomb11
+ BNEnot_button
+.usepl1
+ LDA&FC72:AND#&10:BEQbomb11
+ BNEnot_button
+.kbd_fire
+ LDX#&B6:JSRcheck_key
+ BEQbomb11
+.not_button
+ LDA#0:STAbombdel
+ BEQbomb1
+
+.bomb11
+ LDAbombdel:BNEbomb1
+ LDX#mymaxbull-1
+.bomb2
+ LDAmybullst,X:BPLbomb3
+ DEX:BPLbomb2
+
+.bomb1
+ RTS
+
+.bomb3
+ LDA#&FF:STAmybullst,X
+ LDA#7:STAbombdel:\ WAS 3!
+ STXtemp2
+ INCmybullact
+ LDAmyx:CLC:ADC#2
+ STAmybullx,X:STAtemp1
+ LDAmyy:SEC:SBC#23:AND#&F8
+ STAmybully,X
+ TAY:LDXtemp1
+ JSRmove_bomb
+ LDX#firesnd MOD 256
+ LDY#firesnd DIV 256
+ JMPmksnd
+
+.move_bomb
+ STXalfx
+ JSRxycalc2
+ STAscreen+1:STXscreen
+ LSRalfx:BCSbmbshf
+ LDY#7
+.bomb4
+ LDAbombgra,Y
+ EOR(screen),Y
+ STA(screen),Y
+ DEY:BPLbomb4
+ RTS
+.bmbshf
+ LDY#15:LDX#7
+.bmbshf2
+ LDAbombgr2,X
+ EOR(screen),Y
+ STA(screen),Y
+ DEY:DEX:BPLbmbshf2
+ LDY#6
+ LDA#1:EOR(screen),Y:STA(screen),Y
+.mks2
+ RTS
+
+.bombgra
+ EQUB&22:EQUB&22:EQUB&22:EQUB&22:EQUB&22:EQUB&22
+ EQUB7:EQUB2
+
+.bombgr2
+ EQUB&88:EQUB&88:EQUB&88:EQUB&88:EQUB&88:EQUB&88
+ EQUB12:EQUB8
+
+.firesnd
+ EQUW &11
+ EQUW 2
+ EQUW 100
+ EQUW 5
+
+.mksnd
+ BITwtflg:BMImks2
+ BITsound_flag:BPLmks2
+ BITdemo_flag:BMImks2
+ LDA#7:JMPosword
+
+\\ ]
+\\ PRINT"Bombs 1 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/BOMBS2.asm b/src/BOMBS2.asm
new file mode 100644
index 0000000..c65d995
--- /dev/null
+++ b/src/BOMBS2.asm
@@ -0,0 +1,156 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"BOMBS2"
+\\ B%=P%
+\\ [OPT pass
+
+.process_aliens_bombs
+
+\ Try to init a bomb (random)
+
+ LDAalbullact
+ CMP#almaxbull:BEQnobomb
+ LDAaliensm1:CMP#20:BCCprb2
+ LDAalgra+32
+ CMP#38:BNEprb2
+ LDArand1+1:AND#&F:BNEprb2
+ LDA#32:BNEprb
+.prb2
+ JSRrand
+.bombrate
+ AND#15:BNEnobomb
+ LDArand1+1:AND#63
+ CMPaliens:BCSnobomb
+.prb
+ TAX:LDAalst,X:BPLnobomb
+ LSRA:BCSnobomb
+ JSRinit_bomb
+
+\ Process the alien bombs
+
+.nobomb
+ LDAalbullact:BEQnone_move
+ LDX#almaxbull-1
+.malbomb
+ STXtemp2
+ LDAalbullst,X:BMImalbomb2
+.malbomb3
+ LDXtemp2
+ DEX:BPLmalbomb
+.none_move
+ RTS
+
+.malbomb2
+ LDAalbullspeed,X
+ BMIalways_move
+ LDA#1:BITcounter
+ BNEmalbomb3
+.always_move
+ LDYalbully,X
+ LDAalbullx,X:TAX:STXtemp2+1
+ JSRdisp_bomb
+ LDXtemp2
+ LDAalbully,X
+ CLC:ADC#8
+ STAalbully,X
+ BCCmalbomb4
+ LDA#0:STAalbullst,X
+ DECalbullact
+ JMPmalbomb3
+
+.malbomb4
+ TAY
+ LDAaliensm1
+ CMP#20:BCSmalbomb5
+ LDAcurwave
+ CMP#13:BCCmalbomb5
+ CMP#24:BCShomi1
+ LDAalbullspeed,X
+ BMImalbomb5
+.homi1
+ LDArand1+1:BMImalbomb5
+ LDAmyx:CLC:ADC#2
+ CMPalbullx,X:BEQmalbomb5
+ BCSmalbomb6
+ DECtemp2+1:DECalbullx,X
+ JMPmalbomb5
+.malbomb6
+ INCtemp2+1:INCalbullx,X
+.malbomb5
+ LDXtemp2+1
+ JSRdisp_bomb
+ JMPmalbomb3
+
+\ Subroutine to init a bomb
+\ if possible!
+
+.init_bomb
+ LDAcurwave:CMP#3:BCCno_bomb_allowed
+ LDY#almaxbull-1
+.dropb1
+ LDAalbullst,Y:BPLdropb2
+ DEY:BPLdropb1
+.no_bomb_allowed
+ RTS
+
+.dropb2
+ LDAaly,X
+ CMP#24:BCCno_bomb_allowed
+ CMP#240:BCSno_bomb_allowed
+ ADC#8:AND#&F8
+ STAalbully,Y:STAtemp2
+ CMP#80:BCCany_speed
+ AND#&7F:BCSslow_only
+.any_speed
+ JSRrand
+.slow_only
+ STAalbullspeed,Y
+ LDA#&FF:STAalbullst,Y
+ INCalbullact
+ LDAalx,X:CLC:ADC#2
+ STAalbullx,Y:TAX
+ LDYtemp2
+
+\ Subroutine to display/erase
+\ a bomb.
+
+.disp_bomb
+ STXalfx
+ JSRxycalc2
+ STAscreen+1:STXscreen
+ LSRalfx:BCSdbshf
+ LDY#7
+.disp_b2
+ LDAalbomb,Y
+ EOR(screen),Y
+ STA(screen),Y
+ DEY:BPLdisp_b2
+ RTS
+.dbshf
+ LDY#9
+.dbsh2
+ LDAalbomb2,Y
+ EOR(screen),Y
+ STA(screen),Y
+ DEY:BPLdbsh2
+ RTS
+
+.albomb
+ EQUB10:EQUB&E
+ EQUB&44:EQUB&44:EQUB&44:EQUB&44:EQUB&44:EQUB&44
+
+.albomb2
+ EQUB2:EQUB3
+ EQUB&11:EQUB&11:EQUB&11:EQUB&11:EQUB&11:EQUB&11
+ EQUB8:EQUB8
+
+\\ ]
+\\ PRINT"Bombs 2 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/CHARP.asm b/src/CHARP.asm
new file mode 100644
index 0000000..3c97c67
--- /dev/null
+++ b/src/CHARP.asm
@@ -0,0 +1,249 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"CHARP"
+\\ B%=P%
+\\ [OPT pass
+
+.prnstr
+LDA strdat,Y:STA temp1
+CLC:ADC #4:STA nxt_cht+1
+LDA strdat+1,Y:STA temp1+1
+ADC #0:STA nxt_cht+2
+LDY #0
+LDA (temp1),Y:TAX
+AND #&F8:STA temp2
+TXA:AND #3
+STA temp3+1
+INY:LDA (temp1),Y:STA temp2+1
+INY:LDA (temp1),Y:STA temp3
+INY:LDA (temp1),Y:AND #&88
+STA temp4+1:STA temp5
+LDX temp3+1:BEQ nxt_cht
+.sh_rght
+LSR temp5
+DEX:BNE sh_rght
+
+.nxt_cht
+LDA &FFFF
+STA temp4
+ASL A:ASL A
+CLC:ADC temp4
+STA nxt_clm+1
+LDX #0
+.nxt_clm
+LDA &700,X:\ CHARACTER SET
+STA temp5+1
+LDY #0
+.com_col
+LSR temp5+1
+BCC skipr
+LDA temp5
+EOR (temp2),Y
+STA (temp2),Y
+.skipr
+INY
+CPY #8:BCC com_col
+JSR mv_rgt_pix
+INX
+CPX #5:BNE nxt_clm
+JSR mv_rgt_pix
+INC nxt_cht+1
+BNE nhigh
+INC nxt_cht+2
+.nhigh
+DEC temp3
+BNE nxt_cht
+
+
+.mv_rgt_pix
+LSR temp5
+INC temp3+1
+LDA temp3+1
+CMP #4:BCC ntnxtchr
+LDA #0:STA temp3+1
+LDA temp4+1
+STA temp5
+LDA temp2
+CLC:ADC #8
+STA temp2
+BCC ntnxtchr
+INC temp2+1
+.ntnxtchr
+RTS
+
+.strdat EQUW paustxt
+ EQUW SCRtext
+ EQUW HItext
+ EQUW entering_wave
+ EQUW gameover
+ EQUW pressspace
+ EQUW galaforce
+ EQUW myname
+ EQUW letter_S_Q
+ EQUW letter_K_J
+ EQUW pressspace2
+ EQUW finish1
+ EQUW finish2
+ EQUW finish3
+ EQUW finish4
+ EQUW copyr
+ EQUW p123
+ EQUW tocyc
+ EQUW clou1
+ EQUW clou2
+ EQUW clou3
+ EQUW spxt
+ EQUW entnam
+ EQUW za
+ EQUW zb
+ EQUW plus1
+
+.paustxt
+ EQUW &7FF2:EQUB1:EQUB 8
+ EQUB 17
+
+.SCRtext
+ EQUW &5808:EQUB 3:EQUB &88
+ EQUB28:EQUB12:EQUB27:\ 'SCR'
+
+.HItext
+ EQUW &58A8:EQUB 2:EQUB &88
+ EQUB17:EQUB18:\ 'HI'
+
+.entering_wave
+ EQUW &6740:EQUB 16:EQUB &88
+ EQUB14:EQUB23:EQUB29:EQUB14:\ ENTE
+ EQUB27:EQUB18:EQUB23:EQUB16:\ RING
+ EQUB38:EQUB35:EQUB24:EQUB23:\ ZON
+ EQUB14:EQUB38
+.wave_text
+ EQUB38:EQUB38
+.gameover
+ EQUW &64E8:EQUB 9:EQUB &88
+ EQUB16:EQUB10:EQUB22:EQUB14:\ GAME
+ EQUB38:EQUB24:EQUB31:EQUB14:\ OVE
+ EQUB27:\ R
+
+.pressspace
+ EQUW &73B0:EQUB 19:EQUB 8
+ EQUB25:EQUB27:EQUB14:EQUB28:\ PRES
+ EQUB28:EQUB38:EQUB28:EQUB25:\ S SP
+ EQUB10:EQUB12:EQUB14:EQUB38:\ ACE
+ EQUB29:EQUB24:EQUB38:EQUB25:\ TO P
+ EQUB21:EQUB10:EQUB34:\ LAY
+
+.pressspace2
+ EQUW &7538:EQUB 7:EQUB 8
+ EQUB29:EQUB24:EQUB38:EQUB25:\ TO P
+ EQUB21:EQUB10:EQUB34:\ LAY
+
+.galaforce
+ EQUW &5C00:EQUB 9:EQUB &88
+ EQUB16:EQUB10:EQUB21:EQUB10:\ GALA
+ EQUB15:EQUB24:EQUB27:EQUB12:EQUB14:\ FORCE
+
+.myname
+ EQUW &6100:EQUB 16:EQUB &80
+ EQUB11:EQUB34:EQUB38:EQUB20:\ BY K
+ EQUB14:EQUB31:EQUB18:EQUB23:\ EVIN
+ EQUB38:EQUB14:EQUB13:EQUB32:\ EDW
+ EQUB10:EQUB27:EQUB13:EQUB28:\ ARDS
+
+.letter_S_Q
+ EQUW &7FE8:EQUB 1:EQUB &88
+.sound_letter
+ EQUB 28
+
+.letter_K_J
+ EQUW &7FDA:EQUB 1:EQUB &80
+.key_joy_letter
+ EQUB 20
+
+.finish1
+ EQUW&69FA:EQUB 6:EQUB &88
+ EQUB28:EQUB10:EQUB29:EQUB30:\ SATU
+ EQUB27:EQUB23:\ RN
+
+.finish2
+ EQUW&69F3:EQUB 7:EQUB &88
+ EQUB11:EQUB10:EQUB29:EQUB29:\ BATT
+ EQUB14:EQUB27:EQUB34:\ ERY
+
+.finish3
+ EQUW&6A00:EQUB 5:EQUB &88
+ EQUB29:EQUB30:EQUB27:EQUB11:\ TURB
+ EQUB24:\ O
+
+.finish4
+\ Not used !!
+
+.copyr
+ EQUW&79FA:EQUB 17:EQUB &88
+ EQUB28:EQUB30:EQUB25:EQUB14:\SUPE
+ EQUB27:EQUB18:EQUB24:EQUB27:\RIOR
+ EQUB38:EQUB28:EQUB24:EQUB15:\ SOF
+ EQUB29:EQUB32:EQUB10:EQUB27:\TWAR
+ EQUB14:\ E
+
+.p123
+ EQUW&5E8A:EQUB 14:EQUB 8
+ EQUB25:EQUB27:EQUB14:EQUB28:EQUB28:\ PRESS
+ EQUB38:EQUB1:EQUB38:EQUB2:EQUB38:EQUB24:EQUB27:EQUB38:EQUB3:\ 1 2 OR 3
+
+.tocyc
+ EQUW&6240:EQUB 16:EQUB 8
+ EQUB29:EQUB24:EQUB38:EQUB12:EQUB34:EQUB12:EQUB21:EQUB14:\ CYCLE
+ EQUB38:EQUB12:EQUB24:EQUB21:EQUB24:EQUB30:EQUB27:EQUB28:\ COLOURS
+
+.clou1
+ EQUW&69F0:EQUB 8:EQUB 8
+ EQUB12:EQUB24:EQUB21:EQUB24:EQUB30:EQUB27:EQUB38:EQUB1
+
+.clou2
+ EQUW&6C70:EQUB 8:EQUB &80
+ EQUB12:EQUB24:EQUB21:EQUB24:EQUB30:EQUB27:EQUB38:EQUB2
+
+.clou3
+ EQUW&6EF0:EQUB 8:EQUB &88
+ EQUB12:EQUB24:EQUB21:EQUB24:EQUB30:EQUB27:EQUB38:EQUB3
+
+.spxt
+ EQUW&750B:EQUB 14:EQUB 8
+ EQUB27:EQUB14:EQUB29:EQUB30:EQUB27:EQUB23:EQUB38:\ RETURN
+ EQUB29:EQUB24:EQUB38:\ TO
+ EQUB14:EQUB33:EQUB18:EQUB29:\ EXIT
+
+.entnam
+ EQUW&5D48:EQUB 15:EQUB 8
+ EQUB14:EQUB23:EQUB29:EQUB14:EQUB27:EQUB38:\ ENTER
+ EQUB34:EQUB24:EQUB30:EQUB27:EQUB38:\ YOUR
+ EQUB23:EQUB10:EQUB22:EQUB14:\ NAME
+
+.za
+ EQUW&FFFF:EQUB1:EQUB &88
+.zs
+ EQUB&FF
+
+.zb
+ EQUW&FFFF:EQUB21:EQUB&88
+.zt
+ EQUB0:\ 1 to 8
+ EQUB38:\ space
+ EQUS"1234567":\ score
+ EQUB38:EQUB38:\ spaces
+ EQUS"1234567890":\ name
+
+.plus1
+ EQUW&7FD0:EQUB1:EQUB 8
+.plus2
+ EQUB13
+
+\\ ]
+\\ PRINT"Char print from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%:RETURN
diff --git a/src/CONST.asm b/src/CONST.asm
new file mode 100644
index 0000000..559f86e
--- /dev/null
+++ b/src/CONST.asm
@@ -0,0 +1,37 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"CONST"
+
+maxaliens = 40
+maxpatt = 4
+myheight = 16
+
+alheight = 16
+bullheight = 8
+
+mywidth = 6
+alwidth = 6
+
+process = 5: \\REM WAS 6
+
+mymaxbull = 3
+almaxbull = 6
+
+xstep = 1
+ystep = 4
+
+graph = &2F00
+
+osasci = &FFE3
+osbyte = &FFF4
+oswrch = &FFEE
+osword = &FFF1
+
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/CYCLE.asm b/src/CYCLE.asm
new file mode 100644
index 0000000..9f6b8e0
--- /dev/null
+++ b/src/CYCLE.asm
@@ -0,0 +1,82 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE":2.CYCLE"
+\\ B%=P%
+\\ [OPT pass
+
+.cycle
+ LDX#&AD:\ C key
+ JSRcheck_key:BEQcyc1
+ RTS
+.cyc1
+ JSRend_message
+ LDA#20:JSRoswrch
+ LDX#12:JSRpalc2
+ JSRcyctxt
+ LDX#2
+.cyc2
+ LDAvddef,X:STAvdval,X
+ DEX:BPLcyc2
+
+.cyclop
+ LDA#3:STAtemp1
+ LDX#&B6:\ Return key
+ JSRcheck_key:BEQcycex
+
+.cyclo2
+ INCtemp5
+ LDYtemp1:LDXvdkey,Y
+ JSRcheck_key
+ BNEcyc3
+ LDAtemp5:AND#&F:BNEcyc3
+ LDXtemp1:STXvdwrk+1
+.cyc4
+ INCvdval-1,X
+ LDAvdval-1,X:AND#7
+ BEQcyc4
+ STAvdval-1,X
+ STAvdwrk+2
+ LDX#0
+.cyc5
+ LDAvdwrk,X:BMIcyc3
+ JSRoswrch
+ INX:BNEcyc5
+.cyc3
+ DECtemp1:BNEcyclo2
+ LDX#17:JSRsdel
+ JSRmovestars
+ JSRpause
+ JMPcyclop
+
+.cycex
+ JSRcyctxt:JMPend_message
+
+.cyctxt
+ LDY#32:JSRprnstr
+ LDY#34:JSRprnstr
+ LDY#36:JSRprnstr
+ LDY#38:JSRprnstr
+ LDY#40:JSRprnstr
+ LDY#42:JMPprnstr
+
+.vdval
+ EQUB1:EQUB3:EQUB7
+.vddef
+ EQUB1:EQUB4:EQUB7
+.vdwrk
+ EQUB19
+ EQUB0:EQUB0
+ EQUB0:EQUB0:EQUB0
+.vdkey EQUB&FF
+ EQUB&CF:EQUB&CE:EQUB&EE
+
+\\ ]
+\\ PRINT"Cycle from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/DOWN.asm b/src/DOWN.asm
new file mode 100644
index 0000000..f36b421
--- /dev/null
+++ b/src/DOWN.asm
@@ -0,0 +1,89 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE":2.DOWN"
+\\ MODE7:HIMEM=&4800
+
+osbyte = &FFF4
+HIMEM = &4800
+downaddr = HIMEM
+\\ REM These may change !!
+
+hstxt=&652
+hsnum=&6A2
+
+\\ FORpass=0TO2STEP2:P%=HIMEM
+\\ B%=P%
+\\ [OPT pass
+
+ORG downaddr
+
+\ download routine
+
+.download
+ LDA#&8C:JSRosbyte
+ LDA#4:LDX#1:JSRosbyte
+ LDX#&9F:LDA#0
+.killzp
+ STA0,X
+ DEX:BNEkillzp
+ STA0
+.dowfont
+ LDA#0
+ STA&400,X
+ STA&500,X
+ STA&600,X
+ LDA&1900,X:STA&700,X
+ LDA&1A00,X:STA&A00,X
+ LDA&1B00,X:STA&B00,X
+ INX:BNEdowfont
+ LDY#&2C
+.download2
+ LDA&1C00,X:STA&E00,X
+ INX:BNEdownload2
+ INCdownload2+2
+ INCdownload2+5
+ DEY:BNEdownload2
+
+ LDY#8*7-1
+.coph2
+ LDAhighval,Y:STAhsnum,Y
+ DEY:BPLcoph2
+ LDY#8*10-1
+.coph3
+ LDAhighname,Y:STAhstxt,Y
+ DEY:BPLcoph3
+
+\ LDX#&F LDA#0
+\.killsroms
+\ STA&2A1,X DEX BPLkillsroms
+
+ JMP&EB5:\ MAY CHANGE!!
+
+.highval
+ EQUB0:EQUB0:EQUB3:EQUB0:EQUB0:EQUB0:EQUB0
+ EQUB0:EQUB0:EQUB2:EQUB5:EQUB0:EQUB0:EQUB0
+ EQUB0:EQUB0:EQUB2:EQUB0:EQUB0:EQUB0:EQUB0
+ EQUB0:EQUB0:EQUB1:EQUB5:EQUB0:EQUB0:EQUB0
+ EQUB0:EQUB0:EQUB1:EQUB0:EQUB0:EQUB0:EQUB0
+ EQUB0:EQUB0:EQUB0:EQUB5:EQUB0:EQUB0:EQUB0
+ EQUB0:EQUB0:EQUB0:EQUB3:EQUB0:EQUB0:EQUB0
+ EQUB0:EQUB0:EQUB0:EQUB1:EQUB0:EQUB0:EQUB0
+
+.highname
+ EQUB28:EQUB30:EQUB25:EQUB14:EQUB27:EQUB18:EQUB24:EQUB27:EQUB38:EQUB38
+ EQUB28:EQUB30:EQUB25:EQUB14:EQUB27:EQUB18:EQUB24:EQUB27:EQUB38:EQUB38
+ EQUB28:EQUB30:EQUB25:EQUB14:EQUB27:EQUB18:EQUB24:EQUB27:EQUB38:EQUB38
+ EQUB28:EQUB30:EQUB25:EQUB14:EQUB27:EQUB18:EQUB24:EQUB27:EQUB38:EQUB38
+ EQUB28:EQUB30:EQUB25:EQUB14:EQUB27:EQUB18:EQUB24:EQUB27:EQUB38:EQUB38
+ EQUB28:EQUB30:EQUB25:EQUB14:EQUB27:EQUB18:EQUB24:EQUB27:EQUB38:EQUB38
+ EQUB28:EQUB30:EQUB25:EQUB14:EQUB27:EQUB18:EQUB24:EQUB27:EQUB38:EQUB38
+ EQUB28:EQUB30:EQUB25:EQUB14:EQUB27:EQUB18:EQUB24:EQUB27:EQUB38:EQUB38
+
+\\ ]NEXT
+\\ PRINT"Down from &";~B%;" to &";~P%-1;" (";P%-B%;")"
diff --git a/src/FLAGS.asm b/src/FLAGS.asm
new file mode 100644
index 0000000..a542c0d
--- /dev/null
+++ b/src/FLAGS.asm
@@ -0,0 +1,68 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"FLAGS"
+\\ B%=P%
+\\ [OPT pass
+
+.liveson
+ LDX lives:BEQ noliveson
+ LDA #&7E:STA addres+1:LDA #&B0:STA addres
+.liveon0 LDY #15
+.liveon1 LDA shipgra,Y:EOR(addres),Y:STA(addres),Y:DEY:BPL liveon1
+ LDAaddres:SEC:SBC#16:STAaddres
+ BCSliveon2
+ DEC addres+1
+.liveon2
+ DEX:BNE liveon0
+.noliveson RTS
+
+.flagson
+ LDYcurwave:INY:STYtemp
+ LDA#&7D:STAaddres+1:LDA#&80:STAaddres
+ LDA#&7E:STAaddres1+1:LDA#&C0:STAaddres1
+
+.flag0 LDAtemp:BEQnomoflags
+ CMP#10:BCCflag1
+ SEC:SBC#10:STAtemp
+ LDA#&88
+ LDX#0
+.flago0 PHA:LDY#15
+.flago1 LDAflaggra,X:EOR(addres),Y:STA(addres),Y
+ INX:DEY:BPL flago1
+.poleon
+ PLA:STAflon1+1:LDY#7
+.flon1
+ LDA#&FF:EOR(addres1),Y:STA(addres1),Y
+ DEY:BPLflon1
+ LDAaddres:CLC:ADC#16:STAaddres:LDAaddres+1:ADC#0:STAaddres+1
+ LDAaddres1:CLC:ADC#16:STAaddres1:LDAaddres1+1:ADC#0:STAaddres1+1:BNEflag0
+.nomoflags RTS
+
+.flag1 CMP#5:BCCflag2:SEC:SBC#5:STAtemp:LDA#8:LDX#16:BNEflago0
+.flag2 SEC:SBC#1:STAtemp:LDA#&80:LDX#32:BNEflago0
+
+.flaggra
+\ 10 flag
+ EQUB0:EQUB&CC:EQUB&2E:EQUB&AE:EQUB&2E:EQUB&CC:EQUB0:EQUB0
+ EQUB&FF:EQUB&FF:EQUB&AF:EQUB&AF:EQUB&AF:EQUB&FF:EQUB&FF:EQUB&88
+\ 5 flag
+ EQUB0:EQUB8:EQUB&C:EQUB&E:EQUB&C:EQUB8:EQUB0:EQUB0
+ EQUB&E:EQUB&7F:EQUB&1F:EQUB&7F:EQUB&4F:EQUB&7F:EQUB&E:EQUB8
+\ 1 flag
+ EQUB0:EQUB&80:EQUB&C0:EQUB&E0:EQUB&C0:EQUB&80:EQUB0:EQUB0
+ EQUB&E0:EQUB&F0:EQUB&D2:EQUB&D2:EQUB&D2:EQUB&F0:EQUB&E0:EQUB&80
+
+.shipgra
+ EQUB0:EQUB0:EQUB0:EQUB&15:EQUB&77:EQUB&76:EQUB&77:EQUB&11
+ EQUB8:EQUB&88:EQUB&88:EQUB&CD:EQUB&F7:EQUB&F3:EQUB&FF:EQUB&44
+
+\\ ]
+\\ PRINT"Flags etc. from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/HIGH.asm b/src/HIGH.asm
new file mode 100644
index 0000000..ea6d0af
--- /dev/null
+++ b/src/HIGH.asm
@@ -0,0 +1,190 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE":2.HIGH"
+\\ B%=P%
+\\ [OPT pass
+
+.ahigh
+ BITdemo_flag:BMIahdem
+ LDX#0:STXtemp1
+.ah1
+ LDAti10,X:STAtemp2
+ LDYti7,X:STYtemp1+1
+ LDX#&FF
+.ah2
+ INY:INX:CPX#7:BEQah4
+ LDAmyscore,X:AND#&7F:CMPhsnum,Y
+ BEQah2
+ BCCah3
+ BNEah4
+.ah3
+ INCtemp1
+ LDXtemp1:CPX#8:BCCah1
+.ahdem
+ RTS
+
+.ah4
+ LDAtemp1+1:CMP#7*7-1:BEQah5
+ LDY#7*7-1
+.ah6
+ LDAhsnum,Y:STAhsnum+7,Y
+ DEY:CPYtemp1+1:BNEah6
+
+ LDY#10*7-1
+.ah7
+ LDAhstxt,Y:STAhstxt+10,Y
+ DEY:CPYtemp2:BNEah7
+
+.ah5
+ LDX#0:LDYtemp1+1:INY
+.ah8
+ LDAmyscore,X:AND#&7F:STAhsnum,Y
+ INY:INX:CPX#7:BNEah8
+ LDX#9:LDYtemp2:INY
+ TYA:PHA
+ LDA#38:\ My space character
+.ah9
+ STAhstxt,Y
+ INY:DEX:BPLah9
+ LDAtemp1
+ ASLA:ASLA:ASLA:ASLA
+ CLC:ADC#9*8:PHA
+ JSRpht
+ LDY#44:JSRprnstr
+ PLA:TAY:LDX#40
+ JSRxycalc2
+ STAza+1
+ INX:INX:STXza:\ offset by 2 pixel
+
+\ Turn on KBD IRQs
+ LDA#178:LDX#255:LDY#0
+ JSRosbyte
+
+ PLA:TAX
+ JSRgnam
+ LDY#44:JSRprnstr
+ JSRkbdoff
+ JMPpht
+
+.pht
+ LDA#0:STAwavbase
+ LDA#&63:STAzb+1
+ LDA#&60:STAzb
+.ai1
+ LDXwavbase:INX:STXzt
+ DEX:LDYti7,X:INY
+ LDX#0:STXwavbase+1
+.ai2
+ LDAhsnum,Y:BNEph2
+ CMPwavbase+1:BNEph2
+ LDA#38:BNEph3
+.ph2
+ SEC:RORwavbase+1
+.ph3
+ STAzt+2,X
+ INY:INX:CPX#7:BNEai2
+ LDXwavbase:LDYti10,X:INY
+ LDX#0
+.ai3
+ LDAhstxt,Y:STAzt+11,X
+ INY:INX:CPX#10:BNEai3
+ LDY#48:JSRprnstr
+ LDAzb:CLC:ADC#&80:STAzb
+ LDAzb+1:ADC#2:STAzb+1
+ INCwavbase
+ LDAwavbase:CMP#8:BCCai1
+ RTS
+
+.gnam
+ LDY#10:BNEgn1
+.gn3
+ LDA#7:JSRoswrch
+.gn1
+ STXwavbase:STYwavbase+1
+ LDA#21:LDX#0:JSRosbyte
+.gn6
+ JSRmovestars
+ LDA#&7E:JSRosbyte
+ LDA#&81:LDX#2:LDY#0:JSRosbyte
+ BCSgn6
+ TXA
+ LDXwavbase:LDYwavbase+1
+ CMP#&D:BEQgn2
+ CMP#&7F:BEQhdel
+ CPY#0:BEQgn3
+ CMP#' ':BNEgn7
+ LDA#38:BNEgn8
+.gn7
+ CMP#'A':BCCgn9
+ CMP#'Z'+1:BCSgn3
+ SBC#54:BNEgn8
+.gn9
+ CMP#'0':BCCgn3
+ CMP#'9'+1:BCSgn3
+ SBC#'0'-1
+.gn8
+ STAzs:STAhstxt,X
+ JSRpit
+ LDA#14:STAgnad2+1
+ LDAza:AND#2:BNEgnad1
+ LDA#10:STAgnad2+1
+.gnad1
+ LDAza:CLC
+.gnad2
+ ADC#10:STAza
+ BCCgn4
+ INCza+1
+.gn4
+ INX:DEY:BPLgn1
+.gn2
+ RTS
+
+.hdel
+ CPY#10:BNEhdel2
+ JMPgn3
+.hdel2
+ LDA#14:STAgnad4+1
+ LDAza:AND#2:BEQgnad3
+ LDA#10:STAgnad4+1
+.gnad3
+ LDAza:SEC
+.gnad4
+ SBC#16:STAza
+ BCSgn5
+ DECza+1
+.gn5
+ INY:DEX
+ LDAhstxt,X:STAzs
+ JSRpit
+ LDA#38:\ space
+ STAhstxt,X
+ JMPgn1
+
+.pit
+ TXA:PHA:TYA:PHA
+ LDY#46:JSRprnstr
+ PLA:TAY:PLA:TAX
+ RTS
+
+.ti7
+ EQUB0-1:EQUB7-1:EQUB14-1:EQUB21-1
+ EQUB28-1:EQUB35-1:EQUB42-1:EQUB49-1
+
+.ti10
+ EQUB0-1:EQUB10-1:EQUB20-1:EQUB30-1
+ EQUB40-1:EQUB50-1:EQUB60-1:EQUB70-1
+
+
+.kbdoff
+ LDA#178:LDX#0:LDY#0
+ JMPosbyte
+
+\\ ]
+\\ PRINT"High from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%:RETURN
diff --git a/src/INIT.asm b/src/INIT.asm
new file mode 100644
index 0000000..b63c495
--- /dev/null
+++ b/src/INIT.asm
@@ -0,0 +1,244 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"INIT"
+\\ B%=P%
+\\ [OPT pass
+
+.exec
+ JSRStop
+ SEI
+ LDA#demsnd MOD 256:STA&220
+ LDA#demsnd DIV 256:STA&221
+ CLI
+ LDA#16:LDX#0
+ JSRosbyte:\ Conversion channels=0
+ LDA#163:LDX#128:LDY#1
+ JSRosbyte:\ Turn off ADC IRQs
+ LDX#&FF:TXS
+ LDY#&F:LDA#0
+.setup_hiscore
+ STAmyscore-1,Y
+ DEY:BNEsetup_hiscore
+ LDA#3:STAhiscore+2
+
+\ BBC Ver only!
+
+ \ LDA#&90 LDX#0 LDY#1 JSRosbyte
+
+ JSRpalch
+ JSRseed_rnd
+ JSRstarinit
+ LDY#2:JSRprnstr
+ LDY#4:JSRprnstr
+ LDA#&80:STAsound_flag
+ STApause_flag
+ STAkey_joy_flag
+ STAjoytype
+ JSRdisplay_sound_status
+ JSRdisplay_key_joy_status
+ JSRprnjoytyp
+
+ JSRinit_score
+ JSRwait_for_space
+ TAY
+
+\ The 'game' loop
+
+.restart
+ LDA#3:STAlives
+ STAsixteen_flag:\ +ve allows it to be printed
+ STAextra_life_flag
+ STYcurwave
+ LDAvecwavl,Y:STAwavbase
+ LDAvecwavh,Y:STAwavbase+1
+ LDA#14:LDX#4:JSRosbyte
+ JSRkbdoff
+ JSRflagson
+ LDAdemo_flag:BMIrestart2
+ LDY#0:JSRStartTune
+.restart2
+ SEC:RORwtflg
+ LDA#0:STAwavoff
+ LDY#process:STYaliens
+ DEY:STYaliensm1
+
+ JSRinit_score
+ JMPfirst_life
+
+.next_life
+ JSRliveson
+ LDY#0:LDA(wavbase),Y
+ STAaliens
+ SEC:SBC#1:STAaliensm1
+ CLC:RORwtflg
+ DECwavoff
+ DEClives
+ \ BNEfirst_life
+ \ LDX#lstman MOD 256
+ \ LDY#lstman DIV 256
+ \ JSRmksnd
+.first_life
+ JSRliveson
+ JSRrstall
+ JSRpokmypos
+ LDA#&C0:STAscreen2+1
+ LDAmyx:TAX
+ JSRsus_mygra
+ JSRsprite
+ JSRmessage_loop
+
+.main_loop
+ CLI
+ INCcounter
+ JSRescape
+ JSRrand
+ JSRmove_my_base
+ JSRmovestars
+ JSRinit_new_aliens
+ JSRmove_the_aliens
+ JSRprocess_my_bombs
+ JSRprocess_aliens_bombs
+ JSRcollision
+
+ LDAmyst:BPLmain_loop
+ LDAalmove:BPLmain_loop
+ LDAalbullact:ORAmybullact
+ BNEmain_loop
+ JSRdie_loop
+ LDAlives:BNEnext_life
+ JSRcheck_new_high
+ LDA#&31:STAscreen+1
+ JSRpoke_hi_scr
+ JSRgame_over_loop
+ JSRahigh
+ JSRwait_for_space
+ PHA
+ JSRflagson
+ PLA:TAY
+ JMPrestart
+
+.wait_for_space
+ JSRend_message
+ LDA#0:STAcounter
+
+.space_loop
+ JSRsrlp
+ JSRcycle
+ INCcounter:BEQhsclp
+ LDX#&9D:JSRcheck_key
+ BNEspace_loop
+ JSRend_message
+.jkch
+ LDA#0:STAdemo_flag
+ RTS
+
+.hsclp
+ JSRend_message
+ JSRpht
+.hscl2
+ JSRsrlp
+ INCcounter:BEQinto_demo
+ LDX#&9D:JSRcheck_key
+ BNEhscl2
+ JSRpht
+ JMPjkch
+
+.into_demo
+ JSRpht
+ LDX#&FF:STXdemo_flag
+ STXdemo_count
+ INX:STXdemsect
+ JSRrand:AND#7:\ Random start for demo
+ RTS
+
+.process_demo
+ LDAdemo_flag:BPLnot_in_demo
+ DECdemo_count:BPLnot_in_demo
+ LDArand1+1:STAdemo_direction
+ AND#15:ADC#10:STAdemo_count
+.not_in_demo
+ RTS
+
+.die_loop
+ BITdemo_flag:BMIdl1
+ LDA#15:LDX#0:JSRosbyte
+ LDY#20:JSRStartTune
+.dl2
+ JSRmovestars
+ JSRpause
+ LDX#18:JSRsdel
+ JSRMusicTest
+ BNEdl2
+.dl1
+ RTS
+
+.palch
+ LDX#0
+.palc2
+ LDAvdus,X:BMIvdu2
+ JSRoswrch
+ INX:BNEpalc2
+.vdu2
+ RTS
+
+.vdus
+ EQUB22:EQUB5
+ EQUB23:EQUB1:EQUB0:EQUB0:EQUB0:EQUB0:EQUB0:EQUB0:EQUB0:EQUB0
+ EQUB19:EQUB2:EQUB4:EQUB0:EQUB0:EQUB0
+ EQUB&FF
+
+.lstman
+ EQUW &11
+ EQUW 3
+ EQUW 80
+ EQUW 20
+
+.demsnd
+ CMP#4:BNEexdem2
+ BITpause_flag:BPLexdem2
+ TXA:PHA:TYA:PHA
+ JSRrdp1joy
+ JSRRefresh
+ JSRMusicTest:BNEexdem
+ DECdemsect
+ BPLdemsn2
+ LDA#7:STAdemsect
+.demsn2
+ LDXdemsect:LDYdemtab,X
+ LDAdemo_flag:BPLexdem
+ JSRStartTune
+ JSRRefresh
+.exdem
+ PLA:TAY:PLA:TAX
+.exdem2
+ RTS
+
+.demtab
+ EQUB40:EQUB40:EQUB35:EQUB35
+ EQUB30:EQUB30:EQUB15:EQUB15
+
+.srlp
+ LDX#18:JSRsdel
+ JSRmovestars
+ JMPpause
+
+.rdp1joy
+ BIT&FC72:BVSrdp1jo3
+ LDA&FC70
+.rdp1jo2
+ LDY#0:STAjoyval,Y
+ TYA:EOR#1:STArdp1jo2+1
+ ORA#4:STA&FC70
+.rdp1jo3
+ RTS
+
+\\ ]
+\\ PRINT"Init from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/MUSIC1.asm b/src/MUSIC1.asm
new file mode 100644
index 0000000..a0e083f
--- /dev/null
+++ b/src/MUSIC1.asm
@@ -0,0 +1,158 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE":2.MUSIC1"
+\\ B%=P%
+ D1=0*64
+ D2=1*64
+ D3=2*64
+ D4=3*64
+ Rest=63
+
+\\ [ OPT pass
+
+ \===================================================================
+
+
+ .StartTune
+ SEI
+ STY WK:LDA LT+0,Y:STA get+1:LDA LT+1,Y:STA get+2:LDA#0:STA IX
+ LDX LT+2,Y:LDY #3
+ .SL LDA SPT,X:STA SPD,Y:DEX:DEY:BPL SL
+ LDY WK:LDX LT+3,Y:LDY #2
+ .EL LDA ENVTAB,X:STA ENV,Y:DEX:DEY:BPL EL:LDY WK
+ LDX LT+4,Y:LDY #2
+ .DL LDA DURATAB,X:STA DUR,Y:DEX:DEY:BPL DL
+ LDA #1:STA CNT
+ CLI
+ RTS
+
+ .Refresh
+ LDX #0:STX WK
+ .RL DEC CNT:BNE NOC:LDY IX
+ .get LDA &DDDD,Y:BEQ NOC:INC IX:PHA:AND #Rest:CMP #Rest:BEQ ST:PLA:PHA
+ ASL A:ASL A
+ STA SND+4:TXA:CLC:ADC #&11:STA SND+0:LDA ENV,X:STA SND+2:LDA DUR,X
+ STA SND+6
+ BIT sound_flag:BPL ST
+ LDX #SND MOD 256:LDY #SND DIV 256:LDA #7:JSR &FFF1
+ .ST PLA:ROL A:ROL A:ROL A:AND #3:TAX:LDA SPD,X:STA CNT
+ .NOC
+ RTS
+
+ .MusicTest
+ LDA get+1:STA dat+1:LDA get+2:STA dat+2
+ .ML LDY IX
+ .dat LDA &FFFF,Y:RTS
+
+ .Stop
+ LDX #HAL MOD 256:LDY #HAL DIV 256:STX get+1:STY get+2
+ LDA #0:TAX:STA IX:LDA #15:JMP osbyte
+
+ \====================================================================
+
+ .SND EQUD &00DD00DD:EQUD &00DD00DD
+ .WK EQUB 0
+ .CNT EQUS "012"
+ .IX EQUS "0"
+ .SPD EQUS "0123"
+ .SPT EQUB 5:EQUB 10:EQUB 15:EQUB 20\Lost a Life
+ EQUB 100:EQUB 96:EQUB 93:EQUB 1\In Between Levels
+ EQUB 7:EQUB 14:EQUB 21:EQUB 28\Game Over
+ EQUB 8:EQUB 16:EQUB 24:EQUB 32
+ EQUB 9:EQUB 18:EQUB 27:EQUB 36
+ EQUB 4:EQUB 8:EQUB 12:EQUB 16\Game Start
+ EQUB 3:EQUB 6:EQUB 9:EQUB 12\Demo Music Section "a"
+ .ENV EQUS "012"
+ .ENVTAB
+ EQUB 5:EQUB 6:EQUB 7\Lost a Life
+ EQUB 6:EQUB 6:EQUB 6\Game Start
+ EQUB 4:EQUB 4:EQUB 4\In Between Levels
+ EQUB 8:EQUB 8:EQUB 8\Game Over
+ EQUB 6:EQUB 6:EQUB 5\Demo Music Section "a"
+ .DUR EQUS "012"
+ .DURATAB
+ EQUB 10:EQUB 1:EQUB 1\Lost a Life
+ EQUB 1:EQUB 1:EQUB 1\Game Start, Game Over
+ EQUB 50:EQUB 50:EQUB 50\In Between Levels
+ EQUB 1:EQUB 3:EQUB 10:\ Demo Music Section "a"
+ EQUB 2:EQUB 3:EQUB 14:\ Demo Music Section "d"
+
+ \Data Look-up Table
+ \Contains all the gen pertaining to each individual tune.
+
+ \Order is as follows:
+
+ \Address of channel 1 data. 2
+ \Offset from ch. 1 to ch. 2 data. 1
+ \Offset from ch. 1 to ch. 3 data. 1
+ \Index into speeds table 1
+ \Index into envelopes table 1
+ \Index into durations table 1
+
+ \ Addr1 Index2 Index3 Speed Env Dur
+ \Game Over Music & also Lost a Life Music
+
+ .LOST1
+ EQUB 51+D2:EQUB 52+D2:EQUB 51+D2:EQUB 49+D2
+ EQUB 51+D2:EQUB 49+D2:EQUB 47+D2:EQUB 46+D2
+ EQUB 44+D4:EQUB 39+D4:EQUB 32+D4:EQUB 20+D4:EQUB Rest+D1
+ .HAL EQUB 0
+ .OVER1
+ EQUB Rest+D2
+ .OVER2
+ EQUB Rest+D2
+ .OVER3
+ .LOST2
+ EQUB 51+D1:EQUB 47+D1:EQUB 44+D1:EQUB 39+D1
+ EQUB 47+D1:EQUB 44+D1:EQUB 39+D1:EQUB 35+D1
+ EQUB 44+D1:EQUB 39+D1:EQUB 35+D1:EQUB 32+D1
+ EQUB 39+D1:EQUB 35+D1:EQUB 32+D1:EQUB 27+D1
+ EQUB 35+D1:EQUB 32+D1:EQUB 27+D1:EQUB 23+D1
+ EQUB 27+D1:EQUB 25+D1:EQUB 23+D1:EQUB 22+D1
+ EQUB 20+D1:EQUB 8+D1:EQUB 8+D1:EQUB 8+D1:EQUB 8+D1
+ EQUB 0
+ .LOST3
+ EQUB 8+D4:EQUB 20+D4:EQUB 8+D2:EQUB 8+D2:EQUB 20+D4
+ EQUB 8+D2:EQUB 8+D2:EQUB 20+D2:EQUB 8+D2:EQUB 8+D2
+ EQUB 0
+
+ \Between Levels Music
+
+ .BETW1
+ EQUB 00+D4:EQUB 01+D4:EQUB 02+D4:EQUB 03+D4
+ EQUB 04+D4:EQUB 05+D4:EQUB 06+D4:EQUB 07+D4
+ EQUB 08+D4:EQUB 09+D4:EQUB 10+D4:EQUB 11+D4
+ EQUB 12+D4:EQUB 13+D4:EQUB 14+D4:EQUB 15+D4
+ EQUB 16+D4:EQUB 17+D4:EQUB 18+D4:EQUB 19+D4
+ EQUB 20+D1:EQUB 21+D4
+ EQUB 0
+ .BETW2
+ EQUB 00+D4:EQUB 01+D4:EQUB 02+D4:EQUB 03+D4
+ EQUB 04+D4:EQUB 05+D4:EQUB 06+D4:EQUB 07+D4
+ EQUB 08+D4:EQUB 09+D4:EQUB 10+D4:EQUB 11+D4
+ EQUB 12+D4:EQUB 13+D4:EQUB 14+D4:EQUB 15+D4
+ EQUB 16+D4:EQUB 17+D4:EQUB 18+D4:EQUB 19+D4
+ EQUB 20+D4:EQUB 21+D4:EQUB 22+D4:EQUB 23+D4
+ EQUB 24+D2:EQUB 25+D4
+ EQUB 0
+ .BETW3
+ EQUB 00+D4:EQUB 01+D4:EQUB 02+D4:EQUB 03+D4
+ EQUB 04+D4:EQUB 05+D4:EQUB 06+D4:EQUB 07+D4
+ EQUB 08+D4:EQUB 09+D4:EQUB 10+D4:EQUB 11+D4
+ EQUB 12+D4:EQUB 13+D4:EQUB 14+D4:EQUB 15+D4
+ EQUB 16+D4:EQUB 17+D4:EQUB 18+D4:EQUB 19+D4
+ EQUB 20+D4:EQUB 21+D4:EQUB 22+D4:EQUB 23+D4
+ EQUB 24+D4:EQUB 25+D4:EQUB 26+D4
+ EQUB 27+D3:EQUB 28+D4
+ EQUB 0
+
+\\ ]
+\\ PRINT"Music 1 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/MUSIC2.asm b/src/MUSIC2.asm
new file mode 100644
index 0000000..b509713
--- /dev/null
+++ b/src/MUSIC2.asm
@@ -0,0 +1,147 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE":2.MUSIC2"
+\\ B%=P%
+\\ [OPT pass
+
+ \Game Start Music
+
+ .STRT1
+ EQUB 8+D3:EQUB 8+D1:EQUB 8+D2
+ EQUB 8+D3:EQUB 8+D1:EQUB 8+D4
+ EQUB 8+D2:EQUB 8+D2:EQUB 8+D2:EQUB 8+D2:EQUB 8+D2
+ EQUB 11+D3:EQUB 11+D1:EQUB 11+D2
+ EQUB 11+D3:EQUB 11+D1:EQUB 11+D4
+ EQUB 13+D2:EQUB 13+D2:EQUB 13+D2:EQUB 13+D2:EQUB 13+D2:EQUB 8+D1
+ EQUB 0
+ .STRT2
+ EQUB 11+D3:EQUB 11+D1:EQUB 11+D2
+ EQUB 11+D3:EQUB 11+D1:EQUB 11+D4
+ EQUB 11+D2:EQUB 11+D2:EQUB 11+D2:EQUB 11+D2:EQUB 11+D2
+ EQUB 15+D3:EQUB 15+D1:EQUB 15+D2
+ EQUB 15+D3:EQUB 15+D1:EQUB 15+D4
+ EQUB 17+D2:EQUB 17+D2:EQUB 17+D2:EQUB 17+D2:EQUB 17+D2:EQUB 11+D1
+ EQUB 0
+ .STRT3
+ EQUB 15+D3:EQUB 15+D1:EQUB 15+D2
+ EQUB 15+D3:EQUB 15+D1:EQUB 15+D4
+ EQUB 15+D2:EQUB 15+D2:EQUB 15+D2:EQUB 15+D2:EQUB 15+D2
+ EQUB 18+D3:EQUB 18+D1:EQUB 18+D2
+ EQUB 18+D3:EQUB 18+D1:EQUB 18+D4
+ EQUB 20+D2:EQUB 20+D2:EQUB 20+D2:EQUB 20+D2:EQUB 20+D2:EQUB 15+D1
+ EQUB 0
+
+
+ .DEMa1
+ EQUB 20+D1:EQUB 20+D1:EQUB 20+D1:EQUB 20+D1
+ EQUB 20+D1:EQUB 20+D1:EQUB 20+D1:EQUB 20+D1
+ EQUB 20+D2:EQUB 20+D2:EQUB 20+D2:EQUB 20+D2
+ EQUB 20+D4:EQUB 20+D2:EQUB 20+D4:EQUB 20+D2:EQUB 20+D4
+ EQUB 32+D1:EQUB 32+D1:EQUB 32+D1:EQUB 32+D1
+ EQUB 32+D1:EQUB 32+D1:EQUB 32+D1:EQUB 32+D1
+ EQUB 32+D2:EQUB 32+D2:EQUB 32+D2:EQUB 32+D2
+ EQUB 32+D4:EQUB 32+D2:EQUB 32+D4:EQUB 32+D2:EQUB 32+D4
+ EQUB 30+D1:EQUB 30+D1:EQUB 30+D1:EQUB 30+D1
+ EQUB 30+D1:EQUB 30+D1:EQUB 30+D1:EQUB 30+D1
+ EQUB 30+D2:EQUB 30+D2:EQUB 30+D2:EQUB 30+D2
+ EQUB 30+D4:EQUB 30+D2:EQUB 27+D4:EQUB 27+D2:EQUB 25+D4
+ EQUB 27+D1:EQUB 27+D1:EQUB 27+D1:EQUB 27+D1
+ EQUB 27+D1:EQUB 27+D1:EQUB 27+D1:EQUB 27+D1
+ EQUB 27+D1:EQUB 27+D1:EQUB 27+D1:EQUB 27+D1
+ EQUB 27+D1:EQUB 27+D1:EQUB 27+D1:EQUB 27+D1
+ EQUB 27+D4:EQUB 27+D4:EQUB 27+D2:EQUB 27+D2:EQUB 27+D4
+ EQUB Rest+D1:EQUB 0
+ .DEMa2
+ EQUB 8+D4:EQUB Rest+D4:EQUB 15+D4:EQUB Rest+D4
+ EQUB 8+D4:EQUB 8+D4:EQUB 15+D4:EQUB Rest+D4
+ EQUB 16+D4:EQUB Rest+D4:EQUB 23+D4:EQUB Rest+D4
+ EQUB 16+D4:EQUB 16+D4:EQUB 23+D4:EQUB Rest+D4
+ EQUB 11+D4:EQUB Rest+D4:EQUB 23+D4:EQUB Rest+D4
+ EQUB 11+D4:EQUB 11+D4:EQUB 23+D4:EQUB Rest+D4
+ EQUB 15+D4:EQUB Rest+D4:EQUB 27+D4:EQUB Rest+D4
+ EQUB 15+D2:EQUB 27+D2:EQUB 15+D2:EQUB 13+D2:EQUB 11+D4:EQUB 10+D4
+ EQUB Rest+D1
+ EQUB 0
+ .DEMa3
+ EQUB 20+D4:EQUB Rest+D4:EQUB 23+D4:EQUB Rest+D4
+ EQUB 27+D4:EQUB Rest+D4:EQUB 30+D4:EQUB Rest+D4
+ EQUB 28+D4:EQUB Rest+D4:EQUB Rest+D4:EQUB Rest+D4:EQUB Rest+D4
+ EQUB Rest+D4:EQUB Rest+D4
+ EQUB 30+D2:EQUB 32+D2
+ EQUB 30+D4:EQUB Rest+D4:EQUB Rest+D4:EQUB Rest+D4
+ EQUB 27+D4:EQUB 25+D4:EQUB 23+D4:EQUB 20+D4:EQUB 22+D4:EQUB Rest+D4
+ EQUB Rest+D4:EQUB Rest+D4
+ EQUB 19+D4:EQUB Rest+D4:EQUB 15+D4
+ EQUB 16+D1:EQUB 17+D1:EQUB 18+D1:EQUB 19+D1:EQUB Rest+D1
+ EQUB 0
+
+
+ .DEMb3
+ EQUB 0
+
+
+ .DEMc1
+ EQUB 0
+
+
+
+ .DEMd1
+ EQUB 44+D1:EQUB 40+D1:EQUB 37+D1:EQUB 32+D1
+ EQUB 40+D1:EQUB 37+D1:EQUB 32+D1:EQUB 28+D1
+ EQUB 37+D1:EQUB 32+D1:EQUB 28+D1:EQUB 25+D1
+ EQUB 32+D1:EQUB 28+D1:EQUB 25+D1:EQUB 20+D1
+ EQUB 28+D1:EQUB 25+D1:EQUB 20+D1:EQUB 16+D1
+ EQUB 25+D1:EQUB 20+D1:EQUB 16+D1:EQUB 13+D1
+ EQUB 20+D1:EQUB 16+D1:EQUB 13+D1:EQUB 8+D1
+ EQUB 16+D1:EQUB 13+D1:EQUB 8+D1:EQUB 4+D1
+ EQUB 6+D1:EQUB 11+D1:EQUB 15+D1:EQUB 18+D1
+ EQUB 11+D1:EQUB 15+D1:EQUB 18+D1:EQUB 23+D1
+ EQUB 15+D1:EQUB 18+D1:EQUB 23+D1:EQUB 27+D1
+ EQUB 18+D1:EQUB 23+D1:EQUB 27+D1:EQUB 30+D1
+ EQUB 23+D1:EQUB 27+D1:EQUB 30+D1:EQUB 35+D1
+ EQUB 27+D1:EQUB 30+D1:EQUB 35+D1:EQUB 39+D1
+ EQUB 30+D1:EQUB 35+D1:EQUB 39+D1:EQUB 42+D1
+ EQUB 35+D1:EQUB 39+D1:EQUB 42+D1:EQUB 47+D1
+ EQUB 45+D1:EQUB 40+D1:EQUB 37+D1:EQUB 33+D1
+ EQUB 40+D1:EQUB 37+D1:EQUB 33+D1:EQUB 28+D1
+ EQUB 37+D1:EQUB 33+D1:EQUB 28+D1:EQUB 25+D1
+ EQUB 33+D1:EQUB 28+D1:EQUB 25+D1:EQUB 21+D1
+ EQUB 28+D1:EQUB 25+D1:EQUB 21+D1:EQUB 16+D1
+ EQUB 25+D1:EQUB 21+D1:EQUB 16+D1:EQUB 13+D1
+ EQUB 21+D1:EQUB 16+D1:EQUB 13+D1:EQUB 9+D1
+ EQUB 16+D1:EQUB 13+D1:EQUB 9+D1:EQUB 4+D1
+ EQUB 40+D4:EQUB 42+D4:EQUB 40+D4:EQUB 39+D4
+ EQUB 40+D4:EQUB 39+D4:EQUB 37+D4:EQUB 35+D4:EQUB Rest+D1
+ EQUB 0
+ .DEMd3
+ EQUB 25+D4:EQUB Rest+D4:EQUB Rest+D4:EQUB Rest+D4
+ EQUB Rest+D4:EQUB 27+D4:EQUB 28+D4:EQUB 30+D4
+ EQUB Rest+D4:EQUB 28+D4:EQUB Rest+D4:EQUB 27+D4
+ EQUB Rest+D4:EQUB 23+D4:EQUB Rest+D4:EQUB 25+D4
+ EQUB Rest+D4:EQUB Rest+D4:EQUB Rest+D4:EQUB Rest+D4
+ EQUB Rest+D4:EQUB Rest+D4:EQUB Rest+D4:EQUB Rest+D4
+ EQUB 28+D4:EQUB 30+D4:EQUB Rest+D4:EQUB 32+D4
+ EQUB Rest+D4:EQUB 35+D4:EQUB Rest+D4:EQUB Rest+D4
+ EQUB Rest+D1:EQUB 0
+ .DEMd2
+ EQUB 13+D4:EQUB Rest+D4:EQUB 25+D4:EQUB Rest+D4
+ EQUB 13+D4:EQUB 13+D4:EQUB 25+D4:EQUB Rest+D4
+ EQUB 11+D4:EQUB Rest+D4:EQUB 23+D4:EQUB Rest+D4
+ EQUB 11+D4:EQUB 11+D4:EQUB 23+D4:EQUB Rest+D4
+ EQUB 9+D4:EQUB Rest+D4:EQUB 21+D4:EQUB Rest+D4
+ EQUB 9+D4:EQUB 9+D4:EQUB 21+D4:EQUB Rest+D4
+ EQUB 4+D4:EQUB 16+D4:EQUB 5+D4:EQUB 17+D4
+ EQUB 6+D4:EQUB 18+D4:EQUB 7+D4:EQUB 19+D4
+ EQUB Rest+D1:EQUB 0
+ .CodeEnd
+
+\\ ]
+\\ PRINT"Music 2 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/MUSIC3.asm b/src/MUSIC3.asm
new file mode 100644
index 0000000..f792903
--- /dev/null
+++ b/src/MUSIC3.asm
@@ -0,0 +1,69 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE":2.MUSIC3"
+\\ B%=P%
+\\ [OPT pass
+
+ \16-Zone Music
+
+ .ZONE1
+ EQUB 8+D2:EQUB 8+D2:EQUB 20+D1:EQUB 8+D2:EQUB 8+D1
+ EQUB 8+D2:EQUB 8+D2:EQUB 20+D1:EQUB 8+D2:EQUB 8+D1
+ EQUB 11+D2:EQUB 11+D2:EQUB 18+D1:EQUB 11+D2:EQUB 11+D1
+ EQUB 11+D2:EQUB 11+D2:EQUB 18+D1:EQUB 11+D2:EQUB 11+D1
+ EQUB 13+D2:EQUB 13+D2:EQUB 20+D1:EQUB 13+D2:EQUB 13+D1
+ EQUB 13+D2:EQUB 13+D2:EQUB 20+D1:EQUB 13+D2:EQUB 13+D1
+ EQUB 16+D2:EQUB 16+D2:EQUB 20+D1:EQUB 16+D2:EQUB 16+D1
+ EQUB 16+D2:EQUB 16+D2:EQUB 20+D1:EQUB 16+D2:EQUB 16+D1
+ EQUB 0
+ .ZONE2
+ EQUB 3+D1:EQUB 8+D1:EQUB 11+D1:EQUB 15+D1
+ EQUB 20+D1:EQUB 15+D1:EQUB 11+D1:EQUB 8+D1
+ EQUB 3+D1:EQUB 8+D1:EQUB 11+D1:EQUB 15+D1
+ EQUB 20+D1:EQUB 15+D1:EQUB 11+D1:EQUB 8+D1
+ EQUB 3+D1:EQUB 6+D1:EQUB 11+D1:EQUB 15+D1
+ EQUB 18+D1:EQUB 15+D1:EQUB 11+D1:EQUB 6+D1
+ EQUB 3+D1:EQUB 6+D1:EQUB 11+D1:EQUB 15+D1
+ EQUB 18+D1:EQUB 15+D1:EQUB 11+D1:EQUB 6+D1
+ EQUB 4+D1:EQUB 8+D1:EQUB 13+D1:EQUB 16+D1
+ EQUB 20+D1:EQUB 16+D1:EQUB 13+D1:EQUB 8+D1
+ EQUB 4+D1:EQUB 8+D1:EQUB 13+D1:EQUB 16+D1
+ EQUB 20+D1:EQUB 16+D1:EQUB 13+D1:EQUB 8+D1
+ EQUB 4+D1:EQUB 8+D1:EQUB 11+D1:EQUB 16+D1
+ EQUB 20+D1:EQUB 16+D1:EQUB 11+D1:EQUB 8+D1
+ EQUB 4+D1:EQUB 8+D1:EQUB 11+D1:EQUB 16+D1
+ EQUB 20+D1:EQUB 16+D1:EQUB 11+D1:EQUB 8+D1:EQUB Rest+D1
+ EQUB 0
+ .ZONE3
+ EQUB 32+D2:EQUB 32+D3:EQUB 32+D2:EQUB 30+D1
+ EQUB 32+D2:EQUB 32+D3:EQUB 27+D1:EQUB 30+D1:EQUB 32+D1
+ EQUB 35+D2:EQUB 35+D3:EQUB 35+D2:EQUB 30+D1
+ EQUB 35+D2:EQUB 35+D3:EQUB 30+D1:EQUB 32+D1:EQUB 35+D1
+ EQUB 37+D2:EQUB 37+D3:EQUB 37+D2:EQUB 37+D1
+ EQUB 37+D2:EQUB 37+D3:EQUB 37+D2:EQUB 36+D1
+ EQUB 35+D2:EQUB 35+D3:EQUB 35+D2:EQUB 34+D1
+ EQUB 35+D2:EQUB 35+D1:EQUB 34+D1
+ EQUB 35+D1:EQUB 37+D1:EQUB 35+D1:EQUB 34+D1
+ EQUB 0
+
+ \ Addr1 Speed Env Dur
+ .LT EQUW STRT1:EQUB 23:EQUB 05:EQUB 05
+ EQUW BETW1:EQUB 07:EQUB 08:EQUB 08
+ EQUW OVER1:EQUB 23:EQUB 11:EQUB 05
+ EQUW DEMa1:EQUB 27:EQUB 14:EQUB 11
+ EQUW LOST1:EQUB 03:EQUB 02:EQUB 02
+ EQUW ZONE2:EQUB 03:EQUB 05:EQUB 05
+ EQUW DEMa2:EQUB 27:EQUB 14:EQUB 11
+ EQUW DEMa3:EQUB 27:EQUB 14:EQUB 11
+ EQUW DEMd1:EQUB 27:EQUB 14:EQUB 14
+
+\\ ]
+\\ PRINT"Music 3 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/PATDAT.asm b/src/PATDAT.asm
new file mode 100644
index 0000000..accc6e9
--- /dev/null
+++ b/src/PATDAT.asm
@@ -0,0 +1,368 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"PATDAT"
+\\ B%=P%
+\\ [OPT pass
+
+.patdat0
+ EQUB&86:EQUB9
+ EQUB&83:EQUB12
+ EQUB10:EQUB1
+ EQUB&86:EQUB13
+ EQUB&86:EQUB12
+ EQUB12
+ EQUB&83:EQUB13
+ EQUB6
+
+.patdat1
+ EQUB&97:EQUB13
+ EQUB&94:EQUB11
+ EQUB&98:EQUB12
+ EQUB6
+
+.patdat2
+ EQUB&88:EQUB12
+ EQUB&88:EQUB15
+ EQUB&88:EQUB12
+ EQUB10:EQUB70
+ EQUB&84:EQUB1
+ EQUB4:EQUB3
+ EQUB&84:EQUB3
+ EQUB12
+ EQUB6
+
+.patdat3
+ EQUB&88:EQUB9
+ EQUB&83:EQUB10
+ EQUB&88:EQUB11
+ EQUB&83:EQUB10
+ EQUB0:EQUB0
+
+.patdat4
+ EQUB10:EQUB2
+ EQUB&87:EQUB9
+ EQUB4:EQUB12
+ EQUB12
+ EQUB&87:EQUB9
+ EQUB&87:EQUB11
+ EQUB10:EQUB2
+ EQUB4:EQUB12
+ EQUB&87:EQUB11
+ EQUB12
+ EQUB0:EQUB0
+
+.patdat5
+ EQUB&8D:EQUB12
+ EQUB&88:EQUB0
+ EQUB&84:EQUB3
+ EQUB&88:EQUB6
+ EQUB&88:EQUB5
+ EQUB&8D:EQUB20
+ EQUB6
+
+.patdat6
+ EQUB&84:EQUB18
+ EQUB&85:EQUB9
+ EQUB&86:EQUB18
+ EQUB&88:EQUB9
+ EQUB&85:EQUB18
+ EQUB&86:EQUB9
+ EQUB6
+
+.patdat7
+ EQUB&93:EQUB13
+ EQUB&88:EQUB9
+ EQUB&82:EQUB4
+ EQUB&87:EQUB7
+ EQUB&86:EQUB15
+ EQUB&87:EQUB23
+ EQUB6
+
+.patdat8
+ EQUB&88:EQUB10
+ EQUB&84:EQUB21
+ EQUB&86:EQUB10
+ EQUB&84:EQUB5
+ EQUB&82:EQUB1
+ EQUB&84:EQUB4
+ EQUB&88:EQUB12
+ EQUB&84:EQUB8
+ EQUB&8B:EQUB15
+ EQUB6
+
+.patdat9
+ EQUB&85:EQUB9
+ EQUB&85:EQUB12
+ EQUB&85:EQUB8
+ EQUB&85:EQUB7
+ EQUB&85:EQUB3
+ EQUB&87:EQUB6
+ EQUB&86:EQUB2
+ EQUB&8E:EQUB13
+ EQUB&89:EQUB17
+ EQUB&8A:EQUB13
+ EQUB6
+
+.patdat10
+ EQUB&83:EQUB20
+ EQUB&83:EQUB24
+ EQUB&84:EQUB16
+ EQUB&84:EQUB8
+ EQUB&84:EQUB4
+ EQUB&84:EQUB1
+ EQUB&82:EQUB9
+ EQUB&88:EQUB5
+ EQUB&8A:EQUB13
+ EQUB&87:EQUB21
+ EQUB&85:EQUB10
+ EQUB6
+
+.patdat11
+ EQUB&86:EQUB13
+ EQUB&84:EQUB5
+ EQUB&84:EQUB9
+ EQUB&86:EQUB52
+ EQUB&89:EQUB9
+ EQUB&89:EQUB49
+ EQUB&84:EQUB10
+ EQUB&84:EQUB14
+ EQUB&85:EQUB54
+ EQUB&87:EQUB11
+ EQUB&94:EQUB51
+ EQUB6
+
+.patdat12
+ EQUB&88:EQUB6
+ EQUB&85:EQUB1
+ EQUB&8F:EQUB5
+ EQUB&8F:EQUB6
+ EQUB&88:EQUB5
+ EQUB&85:EQUB3
+ EQUB0:EQUB0
+
+.patdat13
+ EQUB&88:EQUB14
+ EQUB&85:EQUB54
+ EQUB&85:EQUB11
+ EQUB&84:EQUB51
+ EQUB&85:EQUB8
+ EQUB&85:EQUB52
+ EQUB&83:EQUB9
+ EQUB&87:EQUB13
+ EQUB&85:EQUB21
+ EQUB&87:EQUB29
+ EQUB6
+
+.patdat14
+ EQUB10:EQUB1
+ EQUB&8C:EQUB13
+ EQUB&83:EQUB49
+ EQUB&82:EQUB9
+ EQUB&82:EQUB52
+ EQUB&81:EQUB11
+ EQUB&82:EQUB48
+ EQUB&81:EQUB8
+ EQUB&82:EQUB55
+ EQUB&82:EQUB15
+ EQUB&83:EQUB11
+ EQUB&82:EQUB54
+ EQUB&81:EQUB14
+ EQUB&82:EQUB50
+ EQUB&82:EQUB53
+ EQUB12
+ EQUB&87:EQUB13
+ EQUB6
+
+.patdat15
+ EQUB&87:EQUB16
+ EQUB&85:EQUB48
+ EQUB&83:EQUB12
+ EQUB&85:EQUB52
+ EQUB&86:EQUB17
+ EQUB&85:EQUB49
+ EQUB&83:EQUB13
+ EQUB&85:EQUB53
+ EQUB&88:EQUB18
+ EQUB6
+
+.patdat16
+ EQUB&8D:EQUB48
+ EQUB&82:EQUB52
+ EQUB&82:EQUB9
+ EQUB&82:EQUB49
+ EQUB&82:EQUB13
+ EQUB&82:EQUB53
+ EQUB&82:EQUB10
+ EQUB&82:EQUB50
+ EQUB&82:EQUB14
+ EQUB&82:EQUB54
+ EQUB&82:EQUB11
+ EQUB&82:EQUB51
+ EQUB&82:EQUB15
+ EQUB&82:EQUB55
+ EQUB&82:EQUB8
+ EQUB&82:EQUB48
+ EQUB&82:EQUB12
+ EQUB&82:EQUB52
+ EQUB&82:EQUB9
+ EQUB&82:EQUB49
+ EQUB&8E:EQUB53
+ EQUB6
+
+.patdat17
+ EQUB&8D:EQUB21
+ EQUB&83:EQUB49
+ EQUB&84:EQUB9
+ EQUB&85:EQUB12
+ EQUB&84:EQUB8
+ EQUB&83:EQUB15
+ EQUB&83:EQUB23
+ EQUB&84:EQUB15
+ EQUB&83:EQUB11
+ EQUB&84:EQUB14
+ EQUB&83:EQUB22
+ EQUB&83:EQUB14
+ EQUB&84:EQUB10
+ EQUB&85:EQUB13
+ EQUB&84:EQUB9
+ EQUB&83:EQUB52
+ EQUB&8C:EQUB20
+ EQUB&83:EQUB8
+ EQUB6
+
+.patdat18
+ EQUB&86:EQUB13
+ EQUB&86:EQUB14
+ EQUB0:EQUB0
+
+.patdat19
+ EQUB10:EQUB3
+ EQUB&83:EQUB18
+ EQUB&81:EQUB50
+ EQUB12
+ EQUB&85:EQUB54
+ EQUB&84:EQUB11
+ EQUB&96:EQUB&40
+ EQUB10:EQUB1
+ EQUB&85:EQUB15
+ EQUB&84:EQUB8
+ EQUB&84:EQUB12
+ EQUB&83:EQUB52
+ EQUB&83:EQUB9
+ EQUB&83:EQUB13
+ EQUB&83:EQUB10
+ EQUB&83:EQUB14
+ EQUB&84:EQUB54
+ EQUB&88:EQUB11
+ EQUB12
+ EQUB&83:EQUB15
+ EQUB&84:EQUB55
+ EQUB&8C:EQUB8
+ EQUB6
+
+.patdat20
+ EQUB&8C:EQUB10
+ EQUB10:EQUB3
+ EQUB&81:EQUB&40
+ EQUB8
+ EQUB&81:EQUB&40
+ EQUB12
+ EQUB&89:EQUB20
+ EQUB6
+
+.patdat21
+ EQUB&94:EQUB14
+ EQUB&84:EQUB54
+ EQUB&85:EQUB11
+ EQUB&83:EQUB15
+ EQUB&83:EQUB55
+ EQUB&84:EQUB8
+ EQUB&82:EQUB48
+ EQUB&84:EQUB12
+ EQUB&82:EQUB52
+ EQUB&8C:EQUB9
+ EQUB&84:EQUB49
+ EQUB&83:EQUB13
+ EQUB&83:EQUB53
+ EQUB&83:EQUB10
+ EQUB&83:EQUB50
+ EQUB&84:EQUB14
+ EQUB&83:EQUB54
+ EQUB&86:EQUB19
+ EQUB&84:EQUB51
+ EQUB&85:EQUB19
+ EQUB6
+
+.patdat22
+ EQUB&87:EQUB18
+ EQUB&85:EQUB53
+ EQUB&83:EQUB13
+ EQUB&85:EQUB49
+ EQUB&86:EQUB17
+ EQUB&85:EQUB52
+ EQUB&83:EQUB12
+ EQUB&85:EQUB48
+ EQUB&88:EQUB16
+ EQUB6
+
+.patdat23
+ EQUB&9D:EQUB5
+ EQUB&86:EQUB9
+ EQUB&9D:EQUB6
+ EQUB&86:EQUB11
+ EQUB0:EQUB0
+
+.patdat24
+ EQUB&82:EQUB10
+ EQUB&83:EQUB13
+ EQUB&8D:EQUB49
+ EQUB&83:EQUB13
+ EQUB&82:EQUB10
+ EQUB&83:EQUB14
+ EQUB&8D:EQUB54
+ EQUB&83:EQUB14
+ EQUB0:EQUB0
+
+.patdat25
+ EQUB&90:EQUB2
+ EQUB&83:EQUB9
+ EQUB&A0:EQUB2
+ EQUB&8D:EQUB48
+ EQUB6
+
+
+.patdat26
+ EQUB&A5:EQUB5
+ EQUB&90:EQUB6
+ EQUB&84:EQUB1
+ EQUB&90:EQUB4
+ EQUB&A8:EQUB7
+ EQUB6
+
+.patdat27
+EQUB&A4:EQUB9
+EQUB&83:EQUB10
+EQUB&A4:EQUB11
+.patdat28
+EQUB&83:EQUB10
+EQUB&A4:EQUB9
+EQUB&83:EQUB10
+EQUB&A4:EQUB11
+EQUB14
+EQUB2:EQUB27
+
+.patdat29
+EQUB&C5:EQUB1
+EQUB&C5:EQUB3
+EQUB0:EQUB0
+
+\\ ]
+\\ PRINT"Pattern dt from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/PATT.asm b/src/PATT.asm
new file mode 100644
index 0000000..ea2e952
--- /dev/null
+++ b/src/PATT.asm
@@ -0,0 +1,486 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"PATT"
+\\ B%=P%
+\\ [OPT pass
+
+.patt0
+ EQUB1
+ EQUB0:EQUB50
+ EQUB5
+ EQUB20
+ EQUB0:EQUB5
+ EQUB12
+ EQUB0
+
+.patt1
+ EQUB1
+ EQUB73:EQUB50
+ EQUB5
+ EQUB20
+ EQUB0:EQUB5
+ EQUB12
+ EQUB0+&80
+
+.patt2
+ EQUB1
+ EQUB12:EQUB24
+ EQUB4
+ EQUB30
+ EQUB0:EQUB0
+ EQUB18
+ EQUB1
+
+.patt3
+ EQUB1
+ EQUB62:EQUB24
+ EQUB4
+ EQUB30
+ EQUB0:EQUB0
+ EQUB18
+ EQUB1+&80
+
+.patt4
+ EQUB2:\ init 2 patterns
+ EQUB0:EQUB255
+ EQUB20
+ EQUB2
+ EQUB8:EQUB-24
+ EQUB20
+ EQUB2
+\ 2nd half
+ EQUB73:EQUB255:\ was 74 255
+ EQUB20
+ EQUB2
+ EQUB-8:EQUB-24
+ EQUB20
+ EQUB2+&80
+
+.patt5
+ EQUB1
+ EQUB6:EQUB40
+ EQUB50
+ EQUB4
+ EQUB0:EQUB16
+ EQUB24
+ EQUB4
+
+.patt6
+ EQUB2
+ EQUB0:EQUB231
+ EQUB8
+ EQUB10
+ EQUB0:EQUB0
+ EQUB24
+ EQUB5
+\ 2nd part
+ EQUB7:EQUB231
+ EQUB8
+ EQUB10
+ EQUB0:EQUB0
+ EQUB20
+ EQUB5
+
+.patt7
+ EQUB2
+ EQUB73:EQUB231
+ EQUB8
+ EQUB10
+ EQUB0:EQUB0
+ EQUB24
+ EQUB5+&80
+\ 2nd part
+ EQUB66:EQUB231
+ EQUB8
+ EQUB10
+ EQUB0:EQUB0
+ EQUB20
+ EQUB5+&80
+
+.patt8
+ EQUB1
+ EQUB35:EQUB32
+ EQUB6
+ EQUB15
+ EQUB0:EQUB0
+ EQUB20
+ EQUB6
+
+.patt9
+ EQUB1
+ EQUB38:EQUB32
+ EQUB6
+ EQUB15
+ EQUB0:EQUB0
+ EQUB20
+ EQUB6+&80
+
+.patt10
+ EQUB1
+ EQUB0:EQUB32
+ EQUB5
+ EQUB8
+ EQUB0:EQUB0
+ EQUB22
+ EQUB7
+
+.patt11
+ EQUB1
+ EQUB73:EQUB32
+ EQUB5
+ EQUB8
+ EQUB0:EQUB0
+ EQUB22
+ EQUB7+&80
+
+.patt12
+ EQUB2
+ EQUB33:EQUB32
+ EQUB6
+ EQUB12
+ EQUB0:EQUB0
+ EQUB30
+ EQUB8
+\ 2nd part
+ EQUB41:EQUB32
+ EQUB6
+ EQUB12
+ EQUB0:EQUB0
+ EQUB30
+ EQUB8+&80
+
+.patt13
+ EQUB1
+ EQUB0:EQUB130
+ EQUB6
+ EQUB16
+ EQUB0:EQUB0
+ EQUB12
+ EQUB9
+
+.patt14
+ EQUB1
+ EQUB73:EQUB130
+ EQUB6
+ EQUB16
+ EQUB0:EQUB0
+ EQUB12
+ EQUB9+&80
+
+.patt15
+ EQUB1
+ EQUB0:EQUB210
+ EQUB5
+ EQUB12
+ EQUB0:EQUB0
+ EQUB18
+ EQUB10
+
+.patt16
+ EQUB1
+ EQUB73:EQUB210
+ EQUB5
+ EQUB12
+ EQUB0:EQUB0
+ EQUB18
+ EQUB10+&80
+
+.patt17
+ EQUB1
+ EQUB0:EQUB32
+ EQUB7
+ EQUB12
+ EQUB0:EQUB0
+ EQUB14
+ EQUB11
+
+.patt18
+ EQUB1
+ EQUB73:EQUB32
+ EQUB7
+ EQUB12
+ EQUB0:EQUB0
+ EQUB14
+ EQUB11+&80
+
+.patt19
+ EQUB1
+ EQUB48:EQUB32
+ EQUB5
+ EQUB10
+ EQUB0:EQUB0
+ EQUB16
+ EQUB13
+
+.patt20
+ EQUB1
+ EQUB27:EQUB32
+ EQUB5
+ EQUB10
+ EQUB0:EQUB0
+ EQUB16
+ EQUB13+&80
+
+.patt21
+ EQUB1
+ EQUB0:EQUB32
+ EQUB5
+ EQUB8
+ EQUB0:EQUB0
+ EQUB20
+ EQUB14
+
+.patt22
+ EQUB1
+ EQUB73:EQUB32
+ EQUB5
+ EQUB8
+ EQUB0:EQUB0
+ EQUB20
+ EQUB14+&80
+
+.patt23
+ EQUB1
+ EQUB2:EQUB255
+ EQUB3
+ EQUB20
+ EQUB0:EQUB0
+ EQUB20
+ EQUB15
+
+.patt24
+ EQUB1
+ EQUB72:EQUB255
+ EQUB3
+ EQUB20
+ EQUB0:EQUB0
+ EQUB20
+ EQUB15+&80
+
+.patt25
+ EQUB1
+ EQUB6:EQUB255
+ EQUB3
+ EQUB16
+ EQUB0:EQUB0
+ EQUB16
+ EQUB16
+
+.patt26
+ EQUB1
+ EQUB69:EQUB255
+ EQUB3
+ EQUB16
+ EQUB0:EQUB0
+ EQUB16
+ EQUB16+&80
+
+.patt27
+ EQUB1
+ EQUB0:EQUB32
+ EQUB4
+ EQUB14
+ EQUB0:EQUB0
+ EQUB18
+ EQUB17
+
+.patt28
+ EQUB1
+ EQUB73:EQUB32
+ EQUB4
+ EQUB14
+ EQUB0:EQUB0
+ EQUB18
+ EQUB17+&80
+
+.patt29
+ EQUB1
+ EQUB0:EQUB32
+ EQUB2
+ EQUB21
+ EQUB3:EQUB0
+ EQUB30
+ EQUB18
+
+.patt30
+ EQUB1
+ EQUB73:EQUB32
+ EQUB2
+ EQUB21
+ EQUB-3:EQUB0
+ EQUB30
+ EQUB18+&80
+
+.patt31
+ EQUB1
+ EQUB73:EQUB32
+ EQUB4
+ EQUB12
+ EQUB0:EQUB0
+ EQUB32
+ EQUB19
+
+.patt32
+ EQUB1
+ EQUB1:EQUB32
+ EQUB4
+ EQUB12
+ EQUB0:EQUB0
+ EQUB32
+ EQUB19+&80
+
+.patt33
+ EQUB1
+ EQUB78:EQUB32
+ EQUB8
+ EQUB20
+ EQUB0:EQUB0
+ EQUB30
+ EQUB20
+
+.patt34
+ EQUB1
+ EQUB79:EQUB32
+ EQUB8
+ EQUB20
+ EQUB0:EQUB0
+ EQUB30
+ EQUB20+&80
+
+.patt35
+ EQUB1
+ EQUB73:EQUB32
+ EQUB4
+ EQUB14
+ EQUB0:EQUB0
+ EQUB34
+ EQUB21
+
+.patt36
+ EQUB1
+ EQUB0:EQUB32
+ EQUB4
+ EQUB14
+ EQUB0:EQUB0
+ EQUB34
+ EQUB21+&80
+
+.patt37
+ EQUB1
+ EQUB2:EQUB32
+ EQUB4
+ EQUB18
+ EQUB0:EQUB0
+ EQUB16
+ EQUB22
+
+.patt38
+ EQUB1
+ EQUB72:EQUB32
+ EQUB4
+ EQUB18
+ EQUB0:EQUB0
+ EQUB16
+ EQUB22+&80
+
+.patt39
+ EQUB1
+ EQUB78:EQUB32
+ EQUB5
+ EQUB12
+ EQUB0:EQUB0
+ EQUB20
+ EQUB23
+
+.patt40
+ EQUB1
+ EQUB79:EQUB32
+ EQUB5
+ EQUB12
+ EQUB0:EQUB0
+ EQUB20
+ EQUB23+&80
+
+.patt41
+ EQUB1
+ EQUB0:EQUB32
+ EQUB4
+ EQUB18
+ EQUB2:EQUB0
+ EQUB12
+ EQUB24
+
+.patt42
+ EQUB1
+ EQUB73:EQUB32
+ EQUB4
+ EQUB18
+ EQUB-2:EQUB0
+ EQUB12
+ EQUB24+&80
+
+.patt43
+ EQUB2
+ EQUB78:EQUB32
+ EQUB16
+ EQUB20
+ EQUB0:EQUB0
+ EQUB16
+ EQUB25
+\ 2nd part
+ EQUB79:EQUB32
+ EQUB14
+ EQUB20
+ EQUB0:EQUB0
+ EQUB16
+ EQUB25+&80
+
+.patt44
+ EQUB2
+ EQUB78:EQUB32
+ EQUB8
+ EQUB20
+ EQUB0:EQUB0
+ EQUB32
+ EQUB26
+\ part2
+ EQUB79:EQUB32
+ EQUB8
+ EQUB20
+ EQUB0:EQUB0
+ EQUB32
+ EQUB26+&80
+
+.patt45
+EQUB3
+EQUB0:EQUB40
+EQUB1
+EQUB1
+EQUB0:EQUB0
+EQUB38
+EQUB29
+\ part 2
+EQUB0:EQUB72
+EQUB4
+EQUB16
+EQUB0:EQUB0
+EQUB26
+EQUB27
+\ part 3
+EQUB0:EQUB96
+EQUB4
+EQUB15
+EQUB0:EQUB0
+EQUB28
+EQUB28
+
+\\ ]
+\\ PRINT"Patterns from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/ROUT1.asm b/src/ROUT1.asm
new file mode 100644
index 0000000..60ebc46
--- /dev/null
+++ b/src/ROUT1.asm
@@ -0,0 +1,217 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"ROUT1"
+\\ B%=P%
+\\ [OPT pass
+
+.check_joy
+ LDAjoyval-1,X
+ CMP#&C0
+ RTS
+
+.check_joy2
+ LDAjoyval-1,X
+ CMP#&40
+ RORA
+ EOR#&80
+ ROLA
+ RTS
+
+.pause4
+ LDX#&AB:\ H key
+
+.check_key
+ LDA#&81
+ LDY#&FF
+ JSRosbyte
+ CPY#&FF
+ RTS
+
+.delay
+ LDX#3
+.delay2
+ LDY#&E0
+.delay3
+ DEY:BNEdelay3
+ DEX:BNEdelay2
+.nopause
+ RTS
+
+.sdel
+ LDY#0
+.sdel2
+ DEY:BNEsdel2
+ DEX:BNEsdel
+ RTS
+
+.pause
+ JSRsound_on_off
+ JSRpause4:BNEnopause
+ CLC:RORpause_flag
+ LDA#15:LDX#0:JSRosbyte
+.pause1
+ JSRpause4:BEQpause1
+ LDY#0:JSRprnstr
+.pause2
+ JSRpause4:BNEpause2
+.pause3
+ JSRpause4:BEQpause3
+ SEC:RORpause_flag
+ LDY#0:JMPprnstr
+
+.rstall
+ LDA#0
+ STAmyst
+ STAalmove
+ STAprocst
+ STAmybullact
+ STAalbullact
+ STAbombdel
+ STAinitact
+ LDY#maxaliens-1
+.rst1
+ STAalst,Y
+ DEY:BPLrst1
+ LDX#maxpatt-1
+.rst2
+ STAinitst,X:DEX:BPLrst2
+ LDY#mymaxbull-1
+.rst3
+ STAmybullst,Y:DEY:BPLrst3
+ LDY#almaxbull-1
+.rst4
+ STAalbullst,Y:DEY:BPLrst4
+ LDA#37:STAmyx
+ LDA#227:STAmyy
+.seed_rnd
+ LDA&240:EOR&FC:EOR#&5D:ORA#1:STArand1
+ LDA&240:ORA#1:STArand1+1
+ LDA&FC:ORA#1:STArand1+2
+ RTS
+
+.xycalc
+ TXA
+.xycalc4
+ CMP#80:BCCxycalc3
+ SBC#80:JMPxycalc4
+.xycalc3
+ TAX
+ CPY#23:BCSxycalc2
+ LDA#&C0:RTS
+.xycalc2
+ LDA#0:STAtemp1+1
+ TYA:AND#7:STAtemp1
+ TYA:LSRA:LSRA:LSRA:TAY
+ TXA:AND#&FE
+ ASLA:ROLtemp1+1:ASLA:ROLtemp1+1
+ ORAtemp1:ADCline_start,Y:TAX
+ LDAtemp1+1:ADCline_starth,Y
+ RTS
+
+.pokmypos
+ LDXmyx:LDYmyy:JSRxycalc
+ STXscreen:STAscreen+1
+ LDY#myheight:STYtemp1+1
+.sound_exit
+ RTS
+
+.sound_on_off
+ INCcounter_sound
+ LDAcounter_sound
+ AND#&F:BNEsound_exit
+ JSRkey_joy
+ JSRplu1_fbyte
+ LDX#&AE:\ S key
+ JSRcheck_key
+ BNEsound_exit
+ JSRdisplay_sound_status
+ LDAsound_letter
+ EOR#(28 EOR 26)
+ STAsound_letter
+ LDAsound_flag:EOR#&80
+ STAsound_flag
+ LDA#15:LDX#0:JSRosbyte
+.display_sound_status
+ LDY#16:\ display 'S' or 'Q'
+ JMPprnstr
+
+.key_joy
+ LDX#&B9:\ K key
+ JSRcheck_key:BNEsound_exit
+ JSRdisplay_key_joy_status
+ LDAkey_joy_letter
+ EOR#(19 EOR 20)
+ STAkey_joy_letter
+ LDAkey_joy_flag:EOR#&80
+.key_joy2
+ STAkey_joy_flag
+.display_key_joy_status
+ LDY#18:\ display 'K' or 'J'
+ JMPprnstr
+
+.plu1_fbyte
+ LDX#&BA:\ J key
+ JSRcheck_key:BEQplu1_fby2
+ RTS
+.plu1_fby2
+ JSRprnjoytyp
+ LDAplus2
+ EOR#(13 EOR 25)
+ STAplus2
+ LDAjoytype
+ EOR#&80:STAjoytype
+.prnjoytyp
+ LDY#50:\ display 'P' or 'F'
+ JMPprnstr
+
+
+.addrelx
+ EQUB0:EQUBxstep:EQUB0:EQUB-xstep
+ EQUBxstep:EQUBxstep:EQUB-xstep:EQUB-xstep
+ EQUB0:EQUB2*xstep:EQUB0:EQUB-2*xstep
+ EQUB2*xstep:EQUB2*xstep:EQUB-2*xstep:EQUB-2*xstep
+ EQUB0:EQUB3*xstep:EQUB0:EQUB-3*xstep
+ EQUB3*xstep:EQUB3*xstep:EQUB-3*xstep:EQUB-3*xstep
+ EQUB0:EQUB4*xstep:EQUB0:EQUB-4*xstep
+ EQUB4*xstep:EQUB4*xstep:EQUB-4*xstep:EQUB-4*xstep
+ EQUB0:EQUB5*xstep:EQUB0:EQUB-5*xstep
+ EQUB5*xstep:EQUB5*xstep:EQUB-5*xstep:EQUB-5*xstep
+ EQUB0:EQUB6*xstep:EQUB0:EQUB-6*xstep
+ EQUB6*xstep:EQUB6*xstep:EQUB-6*xstep:EQUB-6*xstep
+ EQUB2:EQUB2:EQUB-2:EQUB-2
+ EQUB2:EQUB2:EQUB-2:EQUB-2
+.addrely
+ EQUB-ystep:EQUB0:EQUBystep:EQUB0
+ EQUB-ystep:EQUBystep:EQUBystep:EQUB-ystep
+ EQUB-2*ystep:EQUB0:EQUB2*ystep:EQUB0
+ EQUB-2*ystep:EQUB2*ystep:EQUB2*ystep:EQUB-2*ystep
+ EQUB-3*ystep:EQUB0:EQUB3*ystep:EQUB0
+ EQUB-3*ystep:EQUB3*ystep:EQUB3*ystep:EQUB-3*ystep
+ EQUB-4*ystep:EQUB0:EQUB4*ystep:EQUB0
+ EQUB-4*ystep:EQUB4*ystep:EQUB4*ystep:EQUB-4*ystep
+ EQUB-5*ystep:EQUB0:EQUB5*ystep:EQUB0
+ EQUB-5*ystep:EQUB5*ystep:EQUB5*ystep:EQUB-5*ystep
+ EQUB-6*ystep:EQUB0:EQUB6*ystep:EQUB0
+ EQUB-6*ystep:EQUB6*ystep:EQUB6*ystep:EQUB-6*ystep
+ EQUB-16:EQUB4:EQUB16:EQUB-4
+ EQUB-4:EQUB16:EQUB4:EQUB-16
+
+
+.line_start
+EQUB&0:EQUB&40:EQUB&80:EQUB&C0:EQUB&0:EQUB&40:EQUB&80:EQUB&C0:EQUB&0:EQUB&40:EQUB&80:EQUB&C0:EQUB&0:EQUB&40:EQUB&80:EQUB&C0:EQUB&0:EQUB&40:EQUB&80:EQUB&C0:EQUB&0:EQUB&40:EQUB&80:EQUB&C0:EQUB&0:EQUB&40:EQUB&80:EQUB&C0:EQUB&0:EQUB&40
+EQUB&80:EQUB&C0
+
+.line_starth
+EQUB&58:EQUB&59:EQUB&5A:EQUB&5B:EQUB&5D:EQUB&5E:EQUB&5F:EQUB&60:EQUB&62:EQUB&63:EQUB&64:EQUB&65:EQUB&67:EQUB&68:EQUB&69:EQUB&6A:EQUB&6C:EQUB&6D:EQUB&6E:EQUB&6F:EQUB&71
+EQUB&72:EQUB&73:EQUB&74:EQUB&76:EQUB&77:EQUB&78:EQUB&79:EQUB&7B:EQUB&7C:EQUB&7D:EQUB&7E
+
+\\ ]
+\\ PRINT"Routine 1 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/ROUT2.asm b/src/ROUT2.asm
new file mode 100644
index 0000000..8854fbd
--- /dev/null
+++ b/src/ROUT2.asm
@@ -0,0 +1,177 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"ROUT2"
+\\ B%=P%
+\\ [OPT pass
+
+.collision
+ LDAmyst:BPLcollis2
+ LDAalmove
+ LDX#5
+ CMP#16:BCCnodelex
+ INX
+.nodelex
+ JMPsdel
+
+.collis2
+ LDXaliensm1
+.coll1
+ STXtemp4
+ LDAalst,X:BMIcoll2
+.coll3
+ LDXtemp4
+ DEX:BPLcoll1
+ JMPaliensbombs
+
+\ Check if an alien has hit me
+
+.coll2
+ LSRA:BCScoll3
+ LDAaly,X
+ CMPmyy
+ BCCcoll4
+ SBCmyy
+ CMP#alheight:BCScheck_bomb
+ BCCcoll_xcoord
+.coll4
+ LDAmyy:ADC#1:SEC
+ SBCaly,X
+ CMP#myheight:BCScheck_bomb
+
+.coll_xcoord
+ LDAalx,X
+ CMPmyx
+ BCCcoll5
+ SBCmyx
+ CMP#mywidth:BCScheck_bomb
+ BCCcrash
+.coll5
+ LDAmyx
+ SBCalx,X
+ CMP#alwidth:BCScheck_bomb
+
+.crash
+ SEC:RORmyst
+ LDY#maxaliens-1
+.iym_dead1
+ LDAalst,Y:ORA#1:STAalst,Y
+ DEY:BPLiym_dead1
+ INCaliens:INCaliensm1
+ LDYaliensm1
+ LDA#&81:STAalst,Y
+ LDAmyy:STAaly,Y
+ LDAmyx:STAalx,Y
+ LDA#36:STAalgra,Y
+ JMPexpsnd
+
+\ Now check if an alien has hit one of my bullets
+
+.check_bomb
+ LDAalst,X
+ LSRA:BCScoll3
+ LDY#mymaxbull-1
+.chkalbull
+ STYtemp4+1
+ LDXtemp4
+ LDAmybullst,Y:BMIcab1
+.cab2
+ LDYtemp4+1
+ DEY:BPLchkalbull
+ JMPcoll3
+
+.cab1
+ LDAaly,X
+ CMPmybully,Y:BCCcab2
+ SBCmybully,Y
+ CMP#alheight:BCScab2:\ +bullheight
+
+.cab4
+ LDAalx,X
+ CMPmybullx,Y:BCCcab5
+ SBCmybullx,Y:BNEcab2
+ BEQcrash2
+.cab5
+ LDAmybullx,Y
+ SEC:SBCalx,X
+ CMP#alwidth:BCScab2
+
+.crash2
+ LDA#0:STAmybullst,Y
+ DECalcount,X:PHP:BNEnot_dead
+ LDAalst,X:ORA#1:STAalst,X
+.not_dead
+ LDYtemp4+1
+ LDXmybullx,Y
+ LDAmybully,Y:TAY
+ JSRmove_bomb
+ DECmybullact
+ PLP:BNEnot_dead2
+ LDXtemp4:JSRadd_to_score
+ JSRexpsnd
+.not_dead2
+ JMPcab2
+
+\ Now check if the alien's bombs have hit my ship
+
+.aliensbombs
+ LDY#almaxbull-1
+.albom1
+ STYtemp4+1
+ LDAalbullst,Y:BMIalbom3
+.albom2
+ LDYtemp4+1
+ DEY:BPLalbom1
+ RTS
+
+.albom3
+ LDAmyy
+ CMPalbully,Y:BCCalbom2
+ SBCalbully,Y
+ CMP#myheight:BCSalbom2:\ +bullheight
+
+ LDAmyx
+ CMPalbullx,Y:BCCalbom4
+ SBCalbullx,Y:BNEalbom2
+ BEQcrash3
+.albom4
+ LDAalbullx,Y
+ SEC:SBCmyx
+ CMP#mywidth:BCSalbom2
+
+.crash3
+ LDA#0:STAalbullst,Y
+ LDXalbullx,Y
+ LDAalbully,Y:TAY
+ JSRdisp_bomb
+ DECalbullact
+ JMPcrash
+
+.alien_hits
+ EQUB1:EQUB1:EQUB1:EQUB1:EQUB1
+ EQUB2:EQUB2:EQUB5:EQUB5
+ EQUB1:EQUB2
+ EQUB2
+ EQUB1:\ dummy for my ship
+ EQUB10
+
+.expsnd
+ LDX#exps1 MOD 256
+ LDY#exps1 DIV 256
+ JMPmksnd
+
+.exps1
+ EQUW &11
+ EQUW 1
+ EQUW 200
+ EQUW 3
+
+\\ ]
+\\ PRINT"Routine 2 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/ROUT3.asm b/src/ROUT3.asm
new file mode 100644
index 0000000..fc3495d
--- /dev/null
+++ b/src/ROUT3.asm
@@ -0,0 +1,261 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"ROUT3"
+\\ B%=P%
+\\ [OPT pass
+
+.move_my_base
+ LDAmyst:BPLok_to_move
+ RTS
+
+.ok_to_move
+ JSRprocess_demo
+ LDY#0:STYtemp3+1:STYtemp3
+ BITdemo_flag:BPLmanual_control
+ INY
+ BITdemo_direction:BPLdem_right
+ INY
+.dem_right
+ STYtemp3
+ JMPpossible_move
+
+.manual_control
+ BITkey_joy_flag
+ BMIuse_keyboard
+ BITjoytype:BMIrx1stbyte
+
+ LDX#1:JSRcheck_joy
+ ROLtemp3
+ LDX#1:JSRcheck_joy2
+ ROLtemp3
+ LDX#2:JSRcheck_joy
+ ROLtemp3+1
+ LDX#2:JSRcheck_joy2
+ ROLtemp3+1
+ JMPpossible_move
+
+.rx1stbyte
+ LDA&FCC0:EOR#&FF
+ LSRA:ROLtemp3+1
+ LSRA:ROLtemp3+1
+ LSRA:ROLtemp3
+ LSRA:ROLtemp3
+ JMPpossible_move
+
+.use_keyboard
+ LDX#&9E:JSRcheck_key:\ Z key
+ ROLtemp3
+ LDX#&BD:JSRcheck_key:\ X key
+ ROLtemp3
+ LDX#&B7:JSRcheck_key:\ colon key
+ ROLtemp3+1
+ LDX#&97:JSRcheck_key:\ / key
+ ROLtemp3+1
+
+.possible_move
+ JSRpokmypos
+ LDYtemp3
+ LDAmyx:STAtemp3
+ LDAkey_press_relx,Y
+ CLC:ADCmyx
+ CMP#74:BCSbad_x_position
+ STAmyx
+.bad_x_position
+ LDYtemp3+1
+ LDAmyy:STAtemp3+1
+ LDAkey_press_rely,Y
+ CLC:ADCmyy
+ CMP#165:BCCbad_y_pos
+ CMP#235:BCSbad_y_pos
+.good_y_pos
+ STAmyy
+.bad_y_pos
+ LDYmyy:LDXmyx
+ CPXtemp3:BNEship_has_moved
+ CPYtemp3+1:BEQship_hasnt_moved
+.ship_has_moved
+ JSRxycalc
+ STAscreen2+1
+ STXscreen2
+ LDA#myheight:STAtemp1+1
+ LDAtemp3:LDXmyx
+ JSRsus_mygra
+ JMPsprite
+
+.ship_hasnt_moved
+ LDAdemo_direction
+ EOR#&80
+ STAdemo_direction
+ JMPdelay
+
+.sus_mygra
+ LSRA:BCCnoshf
+ LDAgraph+36+40:PHA
+ LDAgraph+37+40:STAtemp1
+ JMPsu2
+.noshf
+ LDAgraph+36:PHA
+ LDAgraph+37:STAtemp1
+.su2
+ TXA
+ LSRA:BCCnoshf2
+ LDXgraph+36+40
+ LDYgraph+37+40
+ PLA:RTS
+.noshf2
+ LDXgraph+36
+ LDYgraph+37
+ PLA:RTS
+
+.key_press_rely
+ EQUB0:EQUB3:EQUB-3:EQUB0
+.key_press_relx
+ EQUB0:EQUB1:EQUB&FF:EQUB0
+
+\------------------------------
+
+
+.print_scores
+ STXtemp1
+.pscore3
+ LDYscoff,X
+ TXA:LSRA:LDA#0:ADC#&A
+ STAdigdt+2
+ LDAscore_base,X
+ BMIpscr2
+ ASLA:ASLA:ASLA:ASLA
+ STAdigdt+1
+ LDX#15
+.pscore1
+ LDA&5838,Y
+.digdt
+ EOR&A00,X:\ Digit graphics
+ STA&5838,Y
+ DEY
+ DEX:BPLpscore1
+.pscr2
+ LDXtemp1
+ RTS
+
+.init_score
+ JSRreset_score_to_0
+.poke_hi_scr
+ JSRclrhi
+ LDX#8:STXtemp2
+.inscr1
+ LDAscore_base,X:BNEinscr2
+ LDYtemp2:BNEinscr3
+.inscr2
+ LDA#0:STAtemp2
+ JSRprint_scores
+.inscr3
+ INX:CPX#15:BNEinscr1
+ RTS
+
+.add_to_score
+ LDAalgra,X:SEC:SBC#12
+ LSRA:TAX
+ LDAalien_score,X
+
+ LDX#5
+.addscr2
+ PHA
+ JSRprint_scores
+ PLA
+ CLC
+ ADCmyscore,X
+ AND#&7F
+ CMP#10:BCCaddscr3
+ SBC#10
+ STAmyscore,X
+ JSRprint_scores
+ LDA#1
+ DEX:BPLaddscr2
+ JMPreset_score_to_0
+.addscr3
+ STAmyscore,X
+ CPX#2:BNEnot_ten_thousands
+ BITextra_life_flag
+ BMInot_ten_thousands
+ CMP#2:BNEnot_ten_thousands:\ extra life at >=20000
+ SEC:RORextra_life_flag
+ TXA:PHA
+ JSRliveson
+ INClives
+ JSRliveson
+ PLA:TAX
+.not_ten_thousands
+ JMPprint_scores
+
+
+.scoff
+ EQUB0+15:EQUB8+15:EQUB24+15:EQUB32+15
+ EQUB48+15:EQUB56+15:EQUB72+15
+
+ EQUB0:\ Dummy entry
+ EQUB0+15+&98:EQUB8+15+&98:EQUB24+15+&98:EQUB32+15+&98
+ EQUB48+15+&98:EQUB56+15+&98:EQUB72+15+&98
+
+.check_new_high
+ BITdemo_flag:BMInot_new_high
+ LDX#&FF
+.new_high1
+ INX:CPX#7:BEQnot_new_high
+.new_high2
+ LDAmyscore,X:AND#&7F
+ CMPhiscore,X
+ BEQnew_high1
+ BCCnot_new_high
+.copy_to_high
+.copyh2
+ LDAmyscore,X:AND#&7F
+ STAhiscore,X
+ INX:CPX#7:BCCcopyh2
+.not_new_high
+ RTS
+
+.clrhi
+ LDX#12*8-1:LDA#0
+.clrhgh
+ STA&58D0,X
+ DEX:BPLclrhgh
+ RTS
+
+.reset_score_to_0
+ LDY#6:LDA#&80
+.zero_my_score
+ STAmyscore,Y
+ DEY:BPLzero_my_score
+ LDA#0:STAmyscore+6
+ LDX#12*8:\ WAS 11
+.clr_score_screen
+ STA&5837,X
+ DEX:BNEclr_score_screen
+ LDX#6:JMPprint_scores
+
+.toggle_demo_direct
+ LDAdemo_direction:EOR#&80
+ STAdemo_direction
+ RTS
+
+\ Points awarded for aliens
+\ (divided by ten)
+
+.alien_score
+ EQUB2:EQUB2:EQUB2:EQUB2
+ EQUB4:EQUB4:EQUB4:EQUB4
+ EQUB6:EQUB6
+ EQUB8:EQUB8
+ EQUB 2:\ Dummy for my ship
+ EQUB 8
+
+\\ ]
+\\ PRINT"Routine 3 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/ROUT4.asm b/src/ROUT4.asm
new file mode 100644
index 0000000..c756d1b
--- /dev/null
+++ b/src/ROUT4.asm
@@ -0,0 +1,100 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"ROUT4"
+\\ B%=P%
+\\ [OPT pass
+
+.message_loop
+ LDY#&FF
+ LDA#205:STAdummy:\ was 160
+ LDXcurwave:INX:TXA
+.sub10
+ INY
+ CMP#10:BCCsave_wave_text
+ SBC#10:BCSsub10
+.save_wave_text
+ STYwave_text:STAwave_text+1
+ LDY#6:JSRprnstr
+ CLC:JSRcompletion_message
+
+.wait_loop
+ JSRescape
+ LDAmyst:BMIesc_exit
+ JSRmove_my_base
+ JSRmovestars
+ JSRrand
+ JSRprocess_my_bombs
+ JSRpause
+ LDX#13:JSRsdel
+ DECdummy:BNEwait_loop
+.esc_exit
+ SEC:JSRcompletion_message
+ CLC:RORwtflg
+ LDY#6:JMPprnstr
+
+.end_message
+ JSRtitle
+ LDY#14:JSRprnstr
+ LDY#10:JSRprnstr
+ LDY#30:JMPprnstr
+\ LDY#20 JMPprnstr
+
+.escape
+ LDAdemo_flag:BPLnot_demomode
+ LDX #&9D:JSRcheck_key
+ BEQtest_if_already_dead
+ RTS
+.not_demomode
+ LDX#&8F
+ JSRcheck_key:BNEno_escape
+.test_if_already_dead
+ LDAmyst:BMIno_escape
+ JSRliveson
+ LDA#0:STAlives
+ JMPcrash
+.no_escape
+ RTS
+
+.game_over_loop
+ BITdemo_flag:BMIno_escape
+ LDY#10:JSRStartTune
+ LDY#8:JSRprnstr
+.game_over2
+ JSRmovestars
+ JSRpause
+ LDX#19:JSRsdel
+ JSRMusicTest:BNEgame_over2
+ LDY#8:JMPprnstr
+
+
+.chkfbyt
+ LDA&FCC0:AND#&10:CLC:RTS
+
+
+.completion_message
+ PHP
+ LDAcurwave:TAX
+ AND#&F:BNEexit_compl
+ TXA
+ LSRA:LSRA:LSRA
+ BEQexit_compl
+ BITsixteen_flag:BMIexit_compl
+ CLC:ADC#20:TAY
+ CPY#28:BCSexit_compl
+ PLP:BCCnot_second_call
+ LDA#&FF:STAsixteen_flag
+.not_second_call
+ JMPprnstr
+.exit_compl
+ PLP:RTS
+
+\\ ]
+\\ PRINT"Routine 4 from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/SPRITES.asm b/src/SPRITES.asm
new file mode 100644
index 0000000..4ce5c38
--- /dev/null
+++ b/src/SPRITES.asm
@@ -0,0 +1,108 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"SPRITES"
+\\ B%=P%
+\\ [OPT pass
+
+.sprite
+STAgra1+1
+STAgra2+1
+STAgra3+1
+STAgra4+1
+STXgra21+1
+STXgra22+1
+STXgra23+1
+STXgra24+1
+LDAtemp1
+STAgra1+2
+STAgra2+2
+STAgra3+2
+STAgra4+2
+STYgra21+2
+STYgra22+2
+STYgra23+2
+STYgra24+2
+LDX#0
+.display
+LDY#0
+.gra1
+LDA&FFFF,X
+EOR(screen),Y
+STA(screen),Y
+.gra21
+LDA&FFFF,X
+EOR(screen2),Y
+STA(screen2),Y
+INX
+LDY#8
+.gra2
+LDA&FFFF,X
+EOR(screen),Y
+STA(screen),Y
+.gra22
+LDA&FFFF,X
+EOR(screen2),Y
+STA(screen2),Y
+INX
+LDY#&10
+.gra3
+LDA&FFFF,X
+EOR(screen),Y
+STA(screen),Y
+.gra23
+LDA&FFFF,X
+EOR(screen2),Y
+STA(screen2),Y
+INX
+LDY#&18
+.gra4
+LDA&FFFF,X
+EOR(screen),Y
+STA(screen),Y
+.gra24
+LDA&FFFF,X
+EOR(screen2),Y
+STA(screen2),Y
+INX
+LDAscreen
+AND#7:BEQnxt_char_row
+DECscreen
+.check_second
+LDAscreen2
+AND#7:BEQnxt_char_row2
+DECscreen2
+DECtemp1+1:BNEdisplay
+JMPthe_end
+RTS
+.nxt_char_row
+SEC
+LDAscreen
+SBC#&39
+STAscreen
+LDAscreen+1
+SBC#1
+STAscreen+1
+JMPcheck_second
+.nxt_char_row2
+SEC
+LDAscreen2
+SBC#&39
+STAscreen2
+LDAscreen2+1
+SBC#1
+STAscreen2+1
+DECtemp1+1:BEQthe_end
+JMPdisplay
+.the_end
+RTS
+
+\\ ]
+\\ PRINT"Sprites from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/STARS.asm b/src/STARS.asm
new file mode 100644
index 0000000..7897edf
--- /dev/null
+++ b/src/STARS.asm
@@ -0,0 +1,81 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"STARS"
+\\ B%=P%
+\\ [OPT pass
+
+.starinit
+ LDX #90:LDY #30
+ LDA #0:STA addres:STA addres+1:STA whichstar
+.starin0
+ JSR starpos
+ JSR rand:AND #4:ORA addres:CLC:ADC stardat,X:STA stardat,X
+ LDA addres+1:ADC stardat+1,X:STA stardat+1,X
+ LDA addres:CLC:ADC #&40:STA addres
+ LDA addres+1:ADC #1:STA addres+1
+.gcol TYA:PHA
+ JSR rand:EOR&FC:AND#&F:TAY
+ LDA stbyte,Y
+ STA stardat+2,X
+ PLA:TAY
+ LDA stardat+2,X
+ EOR (stardat,X):STA (stardat,X)
+ DEX:DEX:DEX:DEY:BPL starin0
+ RTS
+
+.stbyte
+ EQUB8:EQUB4:EQUB2:EQUB1
+ EQUB&80:EQUB&40:EQUB&20:EQUB&10
+ EQUB&88:EQUB&44:EQUB&22:EQUB&11
+ EQUB8:EQUB&40:EQUB&22:EQUB&10
+
+.movestars
+ LDY #16:LDX whichstar
+ BEQ movestar:DEY
+.movestar LDA stardat+2,X
+ EOR (stardat,X):STA (stardat,X)
+ LDA stardat,X:AND #7
+ CMP #6:BCC doapix
+ BEQnotofb
+ CLC
+.notofb
+ LDA stardat,X
+ ADC #&39:EOR #&80:STA stardat,X
+ LDA stardat+1,X:ADC #1
+ STA stardat+1,X
+ BPL staron
+
+.offbot
+ JSR starpos
+ JMP staron
+
+.doapix INC stardat,X:INC stardat,X
+.staron LDA stardat+2,X
+ EOR (stardat,X):STA (stardat,X)
+ INX:INX:INX:DEY:BNE movestar
+ LDA whichstar:CLC:ADC #48
+ CMP #96:BNE whstarin:LDA #0
+.whstarin STA whichstar:RTS
+
+.starpos JSR rand:AND #1
+ CLC:ADC#&59:STA stardat+1,X
+ CMP #&5A:BEQ offb2
+ JSR rand:AND #&F8:ORA #&40:BNE offb3
+.offb2 JSR rand:AND #&78
+.offb3 STA stardat,X:RTS
+
+.rand LDA rand1:AND #&48:EOR&FC:ADC #&38
+ ASLA:ASLA:ROL rand1+2:ROL rand1+1
+ ROL rand1:LDA rand1:RTS
+
+
+\\ ]
+\\ PRINT"Stars from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/TITLE.asm b/src/TITLE.asm
new file mode 100644
index 0000000..4d1e9b9
--- /dev/null
+++ b/src/TITLE.asm
@@ -0,0 +1,83 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"TITLE"
+\\ B%=P%
+\\ [OPT pass
+
+.title
+ LDA#&F0:STAtemp2
+ LDA#&5B:STAtemp2+1
+ LDA#&30:STAtemp3
+ LDA#&5D:STAtemp3+1
+ LDX#0:STXtemp4+1
+ LDA#&30:STAtemp5
+.gchr
+ LDXtemp4+1
+ LDAtitnam,X:BMItit6
+ STAtemp1
+ ASLA:ASLA:CLC:ADCtemp1
+ TAX
+ LDA#5:STAtemp4
+.tit1
+ LDA&700,X:STAtemp1
+ LDA#4:STAtemp1+1
+ LDY#0
+.tit2
+ LSRtemp1:BCCtit3
+ LDAtemp5
+ EOR(temp2),Y
+ STA(temp2),Y
+ INY
+ LDAtemp5
+ EOR(temp2),Y
+ STA(temp2),Y
+ DEY
+.tit3
+ LDA#8:ANDtemp1
+ BEQtit4
+ LDAtemp5
+ EOR(temp3),Y
+ STA(temp3),Y
+ INY
+ LDAtemp5
+ EOR(temp3),Y
+ STA(temp3),Y
+ DEY
+.tit4
+ INY:INY
+ DECtemp1+1:BNEtit2
+ JSRtitrig:INX
+ DECtemp4:BNEtit1
+ JSRtitrig
+ INCtemp4+1:BNEgchr:\ always
+
+.titrig
+ LDAtemp5:EOR#(&C0 EOR &30)
+ STAtemp5
+ CMP#&C0:BNEtit6
+ LDAtemp2
+ CLC:ADC#8:STAtemp2
+ BCCtit5
+ INCtemp2+1
+.tit5
+ LDAtemp3
+ CLC:ADC#8:STAtemp3
+ BCCtit6
+ INCtemp3+1
+.tit6
+ RTS
+
+.titnam
+ EQUB16:EQUB10:EQUB21:EQUB10:\GALA
+ EQUB15:EQUB24:EQUB27:EQUB12:\FORC
+ EQUB14:EQUB&FF:\E
+
+\\ ]
+\\ PRINT"Title from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%:RETURN
diff --git a/src/VECTORS.asm b/src/VECTORS.asm
new file mode 100644
index 0000000..84f8726
--- /dev/null
+++ b/src/VECTORS.asm
@@ -0,0 +1,210 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"VECTORS"
+\\ B%=P%
+\\ [OPT pass
+
+.vecwavl
+ EQUB wave0 MOD 256
+ EQUB wave1 MOD 256
+ EQUB wave2 MOD 256
+ EQUB wave3 MOD 256
+ EQUB wave4 MOD 256
+ EQUB wave5 MOD 256
+ EQUB wave6 MOD 256
+ EQUB wave7 MOD 256
+ EQUB wave8 MOD 256
+ EQUB wave9 MOD 256
+ EQUB wave10 MOD 256
+ EQUB wave11 MOD 256
+ EQUB wave12 MOD 256
+ EQUB wave13 MOD 256
+ EQUB wave14 MOD 256
+ EQUB wave15 MOD 256
+.vecwavh
+ EQUB wave0 DIV 256
+ EQUB wave1 DIV 256
+ EQUB wave2 DIV 256
+ EQUB wave3 DIV 256
+ EQUB wave4 DIV 256
+ EQUB wave5 DIV 256
+ EQUB wave6 DIV 256
+ EQUB wave7 DIV 256
+ EQUB wave8 DIV 256
+ EQUB wave9 DIV 256
+ EQUB wave10 DIV 256
+ EQUB wave11 DIV 256
+ EQUB wave12 DIV 256
+ EQUB wave13 DIV 256
+ EQUB wave14 DIV 256
+ EQUB wave15 DIV 256
+.vecpatl
+ EQUB patt0 MOD 256
+ EQUB patt1 MOD 256
+ EQUB patt2 MOD 256
+ EQUB patt3 MOD 256
+ EQUB patt4 MOD 256
+ EQUB patt5 MOD 256
+ EQUB patt6 MOD 256
+ EQUB patt7 MOD 256
+ EQUB patt8 MOD 256
+ EQUB patt9 MOD 256
+ EQUB patt10 MOD 256
+ EQUB patt11 MOD 256
+ EQUB patt12 MOD 256
+ EQUB patt13 MOD 256
+ EQUB patt14 MOD 256
+ EQUB patt15 MOD 256
+ EQUB patt16 MOD 256
+ EQUB patt17 MOD 256
+ EQUB patt18 MOD 256
+ EQUB patt19 MOD 256
+ EQUB patt20 MOD 256
+ EQUB patt21 MOD 256
+ EQUB patt22 MOD 256
+ EQUB patt23 MOD 256
+ EQUB patt24 MOD 256
+ EQUB patt25 MOD 256
+ EQUB patt26 MOD 256
+ EQUB patt27 MOD 256
+ EQUB patt28 MOD 256
+ EQUB patt29 MOD 256
+ EQUB patt30 MOD 256
+ EQUB patt31 MOD 256
+ EQUB patt32 MOD 256
+ EQUB patt33 MOD 256
+ EQUB patt34 MOD 256
+ EQUB patt35 MOD 256
+ EQUB patt36 MOD 256
+ EQUB patt37 MOD 256
+ EQUB patt38 MOD 256
+ EQUB patt39 MOD 256
+ EQUB patt40 MOD 256
+ EQUB patt41 MOD 256
+ EQUB patt42 MOD 256
+ EQUB patt43 MOD 256
+ EQUB patt44 MOD 256
+ EQUB patt45 MOD 256
+.vecpath
+ EQUB patt0 DIV 256
+ EQUB patt1 DIV 256
+ EQUB patt2 DIV 256
+ EQUB patt3 DIV 256
+ EQUB patt4 DIV 256
+ EQUB patt5 DIV 256
+ EQUB patt6 DIV 256
+ EQUB patt7 DIV 256
+ EQUB patt8 DIV 256
+ EQUB patt9 DIV 256
+ EQUB patt10 DIV 256
+ EQUB patt11 DIV 256
+ EQUB patt12 DIV 256
+ EQUB patt13 DIV 256
+ EQUB patt14 DIV 256
+ EQUB patt15 DIV 256
+ EQUB patt16 DIV 256
+ EQUB patt17 DIV 256
+ EQUB patt18 DIV 256
+ EQUB patt19 DIV 256
+ EQUB patt20 DIV 256
+ EQUB patt21 DIV 256
+ EQUB patt22 DIV 256
+ EQUB patt23 DIV 256
+ EQUB patt24 DIV 256
+ EQUB patt25 DIV 256
+ EQUB patt26 DIV 256
+ EQUB patt27 DIV 256
+ EQUB patt28 DIV 256
+ EQUB patt29 DIV 256
+ EQUB patt30 DIV 256
+ EQUB patt31 DIV 256
+ EQUB patt32 DIV 256
+ EQUB patt33 DIV 256
+ EQUB patt34 DIV 256
+ EQUB patt35 DIV 256
+ EQUB patt36 DIV 256
+ EQUB patt37 DIV 256
+ EQUB patt38 DIV 256
+ EQUB patt39 DIV 256
+ EQUB patt40 DIV 256
+ EQUB patt41 DIV 256
+ EQUB patt42 DIV 256
+ EQUB patt43 DIV 256
+ EQUB patt44 DIV 256
+ EQUB patt45 DIV 256
+.vecpatdl
+ EQUB patdat0 MOD 256
+ EQUB patdat1 MOD 256
+ EQUB patdat2 MOD 256
+ EQUB patdat3 MOD 256
+ EQUB patdat4 MOD 256
+ EQUB patdat5 MOD 256
+ EQUB patdat6 MOD 256
+ EQUB patdat7 MOD 256
+ EQUB patdat8 MOD 256
+ EQUB patdat9 MOD 256
+ EQUB patdat10 MOD 256
+ EQUB patdat11 MOD 256
+ EQUB patdat12 MOD 256
+ EQUB patdat13 MOD 256
+ EQUB patdat14 MOD 256
+ EQUB patdat15 MOD 256
+ EQUB patdat16 MOD 256
+ EQUB patdat17 MOD 256
+ EQUB patdat18 MOD 256
+ EQUB patdat19 MOD 256
+ EQUB patdat20 MOD 256
+ EQUB patdat21 MOD 256
+ EQUB patdat22 MOD 256
+ EQUB patdat23 MOD 256
+ EQUB patdat24 MOD 256
+ EQUB patdat25 MOD 256
+ EQUB patdat26 MOD 256
+ EQUB patdat27 MOD 256
+ EQUB patdat28 MOD 256
+ EQUB patdat29 MOD 256
+.vecpatdh
+ EQUB patdat0 DIV 256
+ EQUB patdat1 DIV 256
+ EQUB patdat2 DIV 256
+ EQUB patdat3 DIV 256
+ EQUB patdat4 DIV 256
+ EQUB patdat5 DIV 256
+ EQUB patdat6 DIV 256
+ EQUB patdat7 DIV 256
+ EQUB patdat8 DIV 256
+ EQUB patdat9 DIV 256
+ EQUB patdat10 DIV 256
+ EQUB patdat11 DIV 256
+ EQUB patdat12 DIV 256
+ EQUB patdat13 DIV 256
+ EQUB patdat14 DIV 256
+ EQUB patdat15 DIV 256
+ EQUB patdat16 DIV 256
+ EQUB patdat17 DIV 256
+ EQUB patdat18 DIV 256
+ EQUB patdat19 DIV 256
+ EQUB patdat20 DIV 256
+ EQUB patdat21 DIV 256
+ EQUB patdat22 DIV 256
+ EQUB patdat23 DIV 256
+ EQUB patdat24 DIV 256
+ EQUB patdat25 DIV 256
+ EQUB patdat26 DIV 256
+ EQUB patdat27 DIV 256
+ EQUB patdat28 DIV 256
+ EQUB patdat29 DIV 256
+
+
+
+
+\\ ]
+\\ PRINT"Vectors from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/WAVE.asm b/src/WAVE.asm
new file mode 100644
index 0000000..701ce0f
--- /dev/null
+++ b/src/WAVE.asm
@@ -0,0 +1,85 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\ REM SAVE"WAVE"
+\\ B%=P%
+\\ [OPT pass
+
+.wave0
+ EQUB10
+ EQUB0:EQUB2:EQUB43:EQUB1:EQUB11:EQUB10
+ EQUB&FF
+.wave1
+ EQUB8
+ EQUB6:EQUB7:EQUB6:EQUB7:EQUB4
+ EQUB&FF
+.wave2
+ EQUB10
+ EQUB5:EQUB8:EQUB9:EQUB13:EQUB14
+ EQUB&FF
+.wave3
+ EQUB8
+ EQUB10:EQUB11:EQUB23:EQUB24:EQUB2:EQUB3
+ EQUB45
+ EQUB&FF
+.wave4
+ EQUB10
+ EQUB16:EQUB17:EQUB18:EQUB15:EQUB5:EQUB27
+ EQUB&FF
+.wave5
+ EQUB10
+ EQUB6:EQUB7:EQUB6:EQUB7:EQUB12:EQUB19:EQUB20
+ EQUB&FF
+.wave6
+ EQUB8
+ EQUB10:EQUB11:EQUB10:EQUB11:EQUB2:EQUB3
+ EQUB&FF
+.wave7
+ EQUB8
+ EQUB13:EQUB14:EQUB21:EQUB22:EQUB23:EQUB24
+ EQUB45
+ EQUB&FF
+.wave8
+ EQUB10
+ EQUB4:EQUB4:EQUB0:EQUB1:EQUB5:EQUB17:EQUB18
+ EQUB&FF
+.wave9
+ EQUB7
+ EQUB8:EQUB9:EQUB12:EQUB44:EQUB2
+ EQUB&FF
+.wave10
+ EQUB8
+ EQUB25:EQUB26:EQUB15:EQUB16:EQUB29
+ EQUB&FF
+.wave11
+ EQUB10
+ EQUB27:EQUB28:EQUB12:EQUB37:EQUB38:EQUB28
+ EQUB45
+ EQUB&FF
+.wave12
+ EQUB10
+ EQUB29:EQUB30:EQUB8:EQUB9:EQUB31:EQUB32
+ EQUB&FF
+.wave13
+ EQUB8
+ EQUB33:EQUB34:EQUB15:EQUB16:EQUB25:EQUB26
+ EQUB&FF
+.wave14
+ EQUB8
+ EQUB23:EQUB24:EQUB35:EQUB36:EQUB21:EQUB22
+ EQUB&FF
+.wave15
+ EQUB8
+ EQUB39:EQUB40:EQUB3:EQUB10:EQUB11:EQUB41:EQUB42
+ EQUB45
+ EQUB&FF
+
+\\ ]
+\\ PRINT"Wave from &";~B%;" to &";~P%-1;" (";P%-B%;")"
+\\ PAGE=PG%
+\\ RETURN
diff --git a/src/ZPWORK.asm b/src/ZPWORK.asm
new file mode 100644
index 0000000..46dd520
--- /dev/null
+++ b/src/ZPWORK.asm
@@ -0,0 +1,64 @@
+\\
+\\ Galaforce 1 ( Electron ) from the original 6502 source code, adapted to assemble using beebasm
+\\
+\\ (c) Kevin Edwards 1986-2019
+\\
+\\ Twitter @KevEdwardsRetro
+\\
+
+\\REM SAVE"ZPWORK"
+\\P%=0:O%=&3000
+\\[OPT 6
+
+ORG 0
+
+.colour
+.screen EQUB 0
+.savey
+ EQUB 0
+
+.data
+.screen2 EQUB 0
+ EQUB 0
+.temp
+.temp1 EQUB 0
+.length
+ EQUB 0
+
+.width
+.temp2 EQUW 0
+
+.addres
+.temp3 EQUW0
+.addres1
+.temp4 EQUW 0
+.temp5 EQUW 0
+.wavbase EQUW 0
+.stardat SKIP 3 * 31
+.rand1 SKIP 3
+.whichstar EQUB 0
+.counter EQUB0
+.expldelay EQUB0
+
+.initst SKIP maxpatt
+.initx SKIP maxpatt
+.inity SKIP maxpatt
+.initdel SKIP maxpatt
+.initcount SKIP maxpatt
+.initnum SKIP maxpatt
+.initrelx SKIP maxpatt
+.initrely SKIP maxpatt
+.initgra SKIP maxpatt
+.initpnum SKIP maxpatt
+
+.aliens EQUB 0
+.aliensm1 EQUB 0
+
+\\ ]
+\\ PRINT'"Zero page from 0 to &";~P%-1
+\\ PAGE=PG%
+\\ RETURN
+
+\\ DEFFNres2(gap%)
+\\ P%=P%+gap%:O%=O%+gap%
+\\ =6