GalaforceAtomDevDiary
From Retrosoftware
(→Graphic resolution/colours) |
(→Graphic resolution/colours) |
||
| Line 13: | Line 13: | ||
There is a big difference between the BBC/Electron and Atom graphic modes. <br> | There is a big difference between the BBC/Electron and Atom graphic modes. <br> | ||
<br> | <br> | ||
| - | < | + | <i>Resolution:</i><br> |
The first difference is the graphic resolution. The BBC/Electron do have a max monochrome resolution of 640 x 256 pixels while the max monochrome resolution on the Atom is 256 x 192 pixels.<br> | The first difference is the graphic resolution. The BBC/Electron do have a max monochrome resolution of 640 x 256 pixels while the max monochrome resolution on the Atom is 256 x 192 pixels.<br> | ||
<br> | <br> | ||
Revision as of 10:41, 26 September 2011
Contents |
Galaforce Acorn Atom Development Diary
by Kees van Oss
16 August 2011
Galaforce is a shooting game for the BBC/Electron written by Kevin Edwards and distributed by Superior in 1986.
This is a brave attempt to rewrite the source so Galaforce can be played on an Acorn Atom.
To convert a BBC/Electron game to the Atom, you have to deal with a few things:
- Graphic resolution/colours
- Sound
- Keyboard/joystick handling
Graphic resolution/colours
There is a big difference between the BBC/Electron and Atom graphic modes.
Resolution:
The first difference is the graphic resolution. The BBC/Electron do have a max monochrome resolution of 640 x 256 pixels while the max monochrome resolution on the Atom is 256 x 192 pixels.
COLOURS:
The second difference is the max nr of colours which can be displayed simultaniously on the screen. A BBC/Electron can display 2/4/8 colours in graphic mode while the Atom can display 2/4 colours in graphic mode.
COLOUR PALLETTE:
The third big difference is the colur pallete. You can redefine the colours by changing the colour pallete. The Atom has 2 sets of 4 colours which can not be changed.
- All movements have to be changed from a resolution of 160 x 256 (MODE2 and 5) to 128 x 192 pixels (CLEAR4a)
- The nr of colours (MODE2=8, MODE5=4) have to be reduced to 4 because this is the maximum nr of colours the Atom can display in colourmode. This is the reason why MODE5 games are easier to convert then MODE2 games
- The sprite format has to be changed to Atom format due to difference in the bit/colour pixel structure. This is explained in the table below
Program
Kevin Edwards was so generous to send his original source files for the BBC version to Samwise. Because Galaforce was developed back in '86, these files have to be compiled on an original BBC. The binary files are saved to disk.
The binary is build out of MASTER file:
0 REM SAVE"MASTER"
10 MODE7:HIMEM=&7EA0:VDU28,0,24,39,19
20 PRINT'"Game 1.00"
30 *LOAD CONST 1900
40 PAGE=&1900:GOSUB 0
50 *LOAD ZPWORK 1900
60 PAGE=&1900:GOSUB 0
70 *LOAD ABSWORK 1900
80 PAGE=&1900:GOSUB 0
90 FOR pass=4 TO 6 STEP 2
100 P%=&B00:O%=&3000:C%=P%:S%=O%
110 PRINT:FORL=1TO2:VDU141:PRINT"Pass = ";pass:NEXT
120 READfile$
130 IF file$="THE-END" RESTORE:GOTO 170
140 OSCLI"LOAD "+file$+" 1900"
150 PAGE=&1900:GOSUB 0
160 GOTO 120
170 NEXT pass
180 PRINT'"Finished"
190 PRINT"Code start = &";~C%
200 PRINT"End of code = &";~P%-1
210 PRINT"Length = &";~P%-C%;" (";P%-C%;") bytes."
220 PRINT"Bytes left = &";~&297A-P%;" (";&297A-P%;") bytes."
230 OSCLI("LOAD O.SPFONT "+STR$~(S%-&200))
240 OSCLI("LOAD O.DIGITS "+STR$~(S%-&100))
250 OSCLI("LOAD GRAPHIC "+STR$~(S%+&297A-C%))
260 *L.:2.O.DOWN 5500
270 OSCLI("SAVE GAME "+STR$~(S%-&200)+" "+STR$~(&3200-C%+S%)+" 4000 1900")
280 PRINT" CH."CHR$34":2.ALLENV1"CHR$34
290 END
300 DATA SPRITES,INIT,ALIENS1
310 DATA ALIENS2,ALIENS3,ALIENS4,ROUT1,ROUT2,ROUT3,ROUT4,STARS
320 DATA BOMBS1,BOMBS2,CHARP,FLAGS
330 DATA MUSIC1,MUSIC2,:2.MUSIC3,:2.TITLE,:2.HIGH
340 DATA WAVE,PATT,PATDAT,VECTORS
350 DATA THE-END
Description of the files:
- MASTER, This is the main file for creating the binaries
- CONST, Declaration of game constants
- ZPWORK, Declaration of zeropage variables
- ABSWORK, Declaration of game variables
- SPRITES, Routine to erase/plot sprite
- INIT, Initialisation of game variables and main program loop
- ALIENS1/2/3/4, Initialize, process, plot, move, explode aliens
- ROUT1/2/3/4, Check keys/joystick for action, check collisions, handle demo movements and loop intro screens
- STARS, Star initialisation + scrolling
- BOMBS1/2, process my/alien bombs
- CHARP, Character/string printing
- FLAGS, Plot/erase flags for wavenr
- MUSIC1/2, Handles music and soundeffects
- TITLE, Display title in double height/width font
- HIGH, Handle highscore and name input
- WAVE, Definition of patterns per wave
- PATT, Initial data pattern + pointer to moving patterndata
- PATDAT, Moving pattern data
- VECTORS, Table for fast lookup PATT and PATTDAT data
Unfortunately not all files were included (see MISSING). Because I could not get in touch with Kevin, I had to 'reverse engineer' these files from the BBC and Electron binaries. Now I have all files complete.
- MUSIC3, Handles music and soundeffects *** MISSING ***
- DIGITS, score digit image from 0-9 for score and high score *** MISSING ***
- GRAPHIC, sprite image file *** MISSING ***
- DOWN, routine to download the code after loading it into memory *** MISSING ***
Font
The Galaforce font has 39 characters consisting of digits, letters and symbols and are stored in the file SPFONT.
- Digits 0-9, character code 0-9
- Letters A-Z , character code 10-35
- Symbols '.', '-' and SPACE, character code 36-38
You can print single-or double size characters.
To print double size characters, every pixel is scaled to 2 x 2 pixels.
Every pixel is shifted out of the Storage byte and put on screen as a coloured pixel.
A character (5 x 8) is stored 90 degrees rotated (8 x 5).
A character on the screen is 6 x 8 pixels so there's 1 pixel space between 2 characters.
The letter G is stored like this:
Sprites
Alien waves
Joystick
Keyboard
Screenshots
Galaforce Intro screenshot Posted: 16:22, 17 Aug 2011 | Galaforce High Score screenshot Posted: 16:22, 17 Aug 2011 | Galaforce Gamestart screenshot Posted: 15:51, 03 Sep 2011 |