====== Copyright ======
===== N60 BASIC =====
A copyright signature for NOSTROMO occupied the first 9 lines of the BASIC portion.
A player would have to LIST out the BASIC program after loading to have a chance to ever encounter this copyright message.
It does not show up anywhere, ever, in the running game itself.
1 REM**************************
2 REM* *
3 REM* NOSTROMO *
4 REM* *
5 REM* Copyright 1982 ASCII *
6 REM* *
7 REM* by HIROMI OHBA *
8 REM* *
9 REM**************************
===== 6809 =====
One decision when porting I had to make came down to "what should I do with these 9 lines?"
Just delete them?
That didn't seem right.
Instead, I thought the copyright REMarks could make a screen of their own to expose the credits rather than skip, ignore, or delete them.
There were a number of choices of how I could turn these lines into a screen:
- Create a 32x16 block of data and copy it to screen RAM
- Clear the screen somewhere, and copy the 9 lines one after another, spaces and all into a block on the cleared screen
- Clear screen, draw each star as a box and put each specific centered string in their specific place
The first option drastically wastes memory in the assembled binary: 512 bytes plus code to copy it to the screen.
The second option uses far less memory, holding only 26x9 bytes to place on the screen, and the code to do so, something having 9 print statements in a row.
But all those spaces ...
The third option requires the most lines of source code to implement, but ends up using the least space in the assembled binary or memory.
To do this I created and leveraged these functions:
* CLEAR SCREEN - a general function I'd already created elsewhere
* [[COLOR1]] - a simple convenience to reuse code for common color setting events
* [[HLINE]] - draw a horizontal line of repeating characters, such as asterisks
* [[VLINE]] - draw a vertical line of repeating characters
* [[PRINTAT]] - place a string at a given location on screen
* [[INITTMR]] - initialize a countdown timer
* [[WAITSYNC]] - wait for the vertical sync pulse, 50 or 60 of them equals 1 second
With that, drawing the the copyright onto the screen broke down into seven steps
- Use HLINE to place the top of the box characters on screen
- Use VLINE to place the left side of the box characters on screen
- Use VLINE to create the right side of the box characters on screen
- Use HLINE to place the bottom line of the box characters on screen
- Use PRINTAT to write NOSTROMO as a single string
- Use PRINTAT to write Copyright 1982 ASCII as a single string
- Use PRINTAT to write by HIROMI OHBA as a single string
Finally, I needed a pause of some sort before moving on to give the player a short opportunity to see the screen before moving on, without leaving it on screen so long it becomes an irritation over many starts.
Since the game already required a seconds countdown timer, I could use that.
So this is what I came up with expose the copyright remarks as a new screen, rather than skip over or simply delete them unused.
;*********************************************************************
;* COPYRIGHT
;* Display a copyright screen from original REM statements
;* Entry Values
;* None
;* Exit Values
;* None
;* Control Register Modifications
;* A,X,Y
;* Subroutines Called
;* COLOR1,HLINE,VLINE,PRINTAT
;*********************************************************************
COPYRIGHT: ; 1 REM**************************
; 2 REM* *
; 3 REM* NOSTROMO *
; 4 REM* *
; 5 REM* Copyright 1982 ASCII *
; 6 REM* *
; 7 REM* by HIROMI OHBA *
; 8 REM* *
; 9 REM**************************
; 12345678901234567890123456
lbsr COLOR1 ; Setup white letters on black background
BAS0001: ; Draw box top
lda #3 ; start drawing at ...
sta TX ; ... column 3
sta TY ; ... row 3
lda #29 ; for 29 horizontal characters
sta INDEXIX ; working varable for horizontal count
ldb #$6A ; '* to draw
lbsr HLINE ; now go draw horizonal line of *
; Draw box left side
ldd #$0304 ; draw vertical line of * at column 3
sta TX ; ... column 3
stb TY ; ... row 4
lda #11 ; for 8 vertical characters
sta INDEXIY ; working variable for vertical count
ldb #$6A ; '* to draw
lbsr VLINE ; now go draw vertical line of *
; Draw box right side
ldd #$1C04 ; draw vertical line of * at column 29
sta TX ; ... column 29
stb TY ; ... row 4
lda #11 ; for 8 vertical characters
sta INDEXIY ; working varable for vertical count
ldb #$6A ; '* to draw
lbsr VLINE ; now go draw vertical line of *
; Draw box bottom
ldd #$030B ; start drawing at ...
sta TX ; ... column 3
stb TY ; ... row 11
lda #29 ; for 29 horizontal characters
sta INDEXIX ; working variable for horizontal count
ldb #$6A ; '* to draw
lbsr HLINE ; now go draw horizontal line of *
; Draw TXTNAME program name message
ldd #$0C05 ; start drawing at ...
sta TX ; ... column 12
stb TY ; ... row 5
ldx #TXTNAME ; load X with pointer to string
stx STRPTR ; ... and store in temp
lda #8 ; load Y with length of string
sta STRLEN ; ... and store in temp
lbsr PRINTAT ; now go print string at
; Draw TXTCOPY copyright message
ldd #$0707 ; start drawing at ...
sta TX ; ... column 7
stb TY ; ... row 7
ldx #TXTCOPY ; load X with pointer to string
stx STRPTR ; ... and store in temp
lda #20 ; load Y with length of string
sta STRLEN ; ... and store in temp
lbsr PRINTAT ; now go print string at
; Draw TXTAUTH author message
ldd #$0909 ; start drawing at ...
sta TX ; ... column 12
stb TY ; ... row 9
ldx #TXTAUTH ; load X with pointer to string
stx STRPTR ; ... and store in temp
lda #14 ; load Y with length of string
sta STRLEN ; ... and store in temp
lbsr PRINTAT ; now go print string at
; FIXME TEST CODE
lbsr INITTMR ; INITIALIZE TIMER ROUTINE
lda #1 ; LETS WAIT 5 SECONDS
sta SECONDS ; STORE FOR NUMBER OF SECONDS TO WAIT
WAIT1: lbsr WAITSYNC ; WAIT FOR VSYNC
lda SECONDS ; HAS SECONDS COUNTED OUT TO 0?
cmpa #0 ; Out of Seconds?
bne WAIT1 ; NO, SECONDS WAS > 0 SO WAIT MORE
Return to [[:Nostromo:]]