VZ 2000 Newsletter
VZ Family
Laser 110 - Laser 200 - Laser 210 - Laser 310 - VZ200 - VZ300 - Texet TX8000 - Salora Fellow


Issue #2 October 2001

By Jason Oakley



Welcome to the second issue of the VZ 2000 Newsletter.

Many more VZ programs have been converted over to run on the emulators now and there are so many different emulators around: VZ Em, WinVZ, MESS and more in the works according to Guy Thomason. (Keep your eyes out for J-Zed .. A Java version of the VZ emulator, rumoured to be in the works and hopefully you will be able to click on a VZ game and play it online.. I can't wait for that one. Just don't let the boss know you are playing it!). There's also an AmigaVZ on the way.. Stay tuned.

I first started mucking about with the VZ not long after it came out around 1983 in Australia and thanks to retro fanatics, I will be playing VZ games and programming them for many years to come.

In this edition, I would like to start off with an Assembly routine I wrote for Arkaball. I used this routine for displaying the current score on the screen. It was later adapted to also display the bricks on the screen quickly.

        .globl  score
; ----- score(int addr, char byte)
score:          push    ix
                        ld      ix, #0
                        add     ix, sp
                        ld      l,6(ix)       ; HL = addr      
                        ld      h,7(ix)       
                        ld      a,#5
                        ld      (counter),a
                        ld      a,4(ix)       ; A = byte
                        cp      #0
                        ld      de,#numbers
                        jr      z,showit
countit:        inc     de
                        inc     de
                        inc     de
                        inc     de
                        inc     de
                        dec     a
                        jr      nz,countit
showit:
                        ld      a,(de)
                        inc     de
                        ld      (hl),a
                        ld      bc,#32                   ; A line's length
                        add     hl,bc
                        ld      a,(counter)
                        dec     a
                        ld      (counter),a
                        jr      nz,showit
                        pop     ix
                        ret

        .area   _DATA           
counter: .byte 0x00
numbers:
                ; 0
                .byte 0x3F
                .byte 0x33
                .byte 0x33
                .byte 0x33
                .byte 0x3F
                
                ; 1
                .byte 0x3C
                .byte 0x0C
                .byte 0x0C
                .byte 0x0C
                .byte 0x3F
                
                ; 2
                .byte 0x3F
                .byte 0x03
                .byte 0x0C
                .byte 0x30
                .byte 0x3F
                
                ; 3
                .byte 0x3F
                .byte 0x03
                .byte 0x0F
                .byte 0x03
                .byte 0x3F
                
                ; 4
                .byte 0x33
                .byte 0x33
                .byte 0x3F
                .byte 0x03
                .byte 0x03
                
                ; 5
                .byte 0x3F
                .byte 0x30
                .byte 0x0C
                .byte 0x03
                .byte 0x3F
                
                ; 6
                .byte 0x3F
                .byte 0x30
                .byte 0x3F
                .byte 0x33
                .byte 0x3F

                ; 7
                .byte 0x3F
                .byte 0x03
                .byte 0x03
                .byte 0x03
                .byte 0x03
                
                ; 8
                .byte 0x3F
                .byte 0x33
                .byte 0x0C
                .byte 0x33
                .byte 0x3F
                
                ; 9
                .byte 0x3F
                .byte 0x33
                .byte 0x3F
                .byte 0x03
                .byte 0x3F

Explanation:

The first few lines deal with grabbing the value out of the C compiled part. Next, we compare the value with Zero (0). If so, we jump off to the SHOWIT part of the routine to display the image.
After that, update the graphics data pointer so we are pointing at the number '1'. Decrease the counter and see if it equals Zero. If so, display a '1' to the screen. Update the pointer again and decrease the number again. This goes on nine times until we are sure the value has been displayed. Quite simple, really, but certainly effective.


This is Juergen's C routine I uhh... 'borrowed' to use in Arkaball.. very handy for taking each number out of a score to display on the screen. Unfortunately, due to the size of VZ registers, once C programs are compiled the variable value range is -32768 to 32767. This leads to the problem that the largest positive number you can have for a score is 32767. In games, however, most scores go up by tens, so you can overcome this by sticking a static '0' (zero) at the end of a score display, effectively giving you a maximum value of 327670 which although not very large, is sufficient for some games. So, when someone shoots that alien, you bump the score up by say 14 but the score looks like it shows 140, nifty huh?? My addition to the routine allows you to set the value of 'l' to display a '0' at the end position, if needed.
/* Score Display Routine */
/* 0<=x<=26 0<=y<=59 0<=n<=32767 */
Display_Score(x, y, n, l)
int x, y, n, l;
{
        int i, location;
        location = (32 * y) + x + 28672;
        if (l) score(location + 5,0);

        for (i = 4; n > 0 && i >= 0; i--)
        {
                location = (32 * y) + x + 28672;
                score(location + i, (n % 10));
                n = n / 10;
        }
}


Next we have what every gamer CRAVES..

CHEAT POKES!!

Okay.. if you don't know what these are, they are ways for you to play your games to death. That's right.. Unlimited or mostly unlimited lives! It took me a long time of playing each game and changing values over and over until I managed to hunt down the required value(s). So lets get it going..

Instructions: Load up your favourite game and type in the corresponding POKE(s) to cheat your game.

GHOST HUNTER:
POKE -30899,60 : REM WHEN YOU DIE, LIVES LEFT INCREASE
POKE -32525,255 : REM START WITH 255 LIVES
POKE -30901,202 : REM INFINITE LIVES

VZ INVADERS:
POKE -31382,163 : REM INFINITE LIVES

GALAXON:
POKE 32749,0 : REM INFINITE LIVES