50% developed

Signetics 2650 & 2636 programming/Score

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Tutorial — Score

[edit | edit source]
$1FC3 7 6 5 4 3 2 1
0 two 2-digit top
1 one 4-digit bottom
See also: 2636 PVI

Four score digits can be programmed to appear at the top or bottom of the screen. They may be arranged as either one group of four digits, or two groups of two digits. The digits displayed are programmed as BCD (Binary Coded Decimal). If any nibble is set as greater than or equal to $A, the corresponding digit is left blank.

Tutorial code

[edit | edit source]

The code for this tutorial can be found at Tutorial code - score. Once it is assembled and run you should see a screen like the one shown here.

This is the part of the program that sets up the score:

000F  0403    :        lodi,r0 $03
0011  CC1FC3  :        stra,r0 scoreformat  
0014  0498    :        lodi,r0 $98
0016  CC1FC8  :        stra,r0 score12
0019  0476    :        lodi,r0 $76
001B  CC1FC9  :        stra,r0 score34   

Both bits in scoreformat are set to one, so the score digits appear as a single block of four characters at the bottom of the screen. One way of changing this would be to edit the assembly language file and assemble it. There are faster ways to experiment with this using some tools in WinArcadia.

WinArcadia tools

[edit | edit source]
See also: WinArcadia and Getting started

One way we can make changes is to directly edit the values in the PVI in real-time. From the Tools menu, open the PVI monitor. The top panel lets you change the registers in the PVI. Change SCORELT from 98 to 2A and the displayed score will change from 9876 to 2 76. Notice how the use of the hex digit A displays as a blank. Now change SCORECTRL from 03 to 00 and see how the score moves to the top of the screen and displays as two, two-digit numbers.


It is also possible to change the machine code that the assembler has created. First though we should run our program again: File > Reset to game and that should return the screen to its original condition.

Refer to the code snippet above, and see how the value $03 that gets put into the scoreformat register appears in the machine code at address $0010. Open the Memory editor from the Tools menu and click on the box containing 03 at $0010. This opens a dialogue box where this byte can be changed. Set it to 0. Notice that the emulator screen has not changed. This is because we have only changed the program and we still have to execute it, which we do once again via File > Reset to game. Now the score digits should be displayed as 98 76 at the top of the screen.