Code: Select all
;***************************************************************************
; DEFINE SECTION
;***************************************************************************
INCLUDE "VECTREX.I"
rotangle equ $c886 ; Rotation angle
rotated equ $c890 ; Takes up some RAM (the rotated coordinates)
ROTVL equ $f610
xpos equ $c892
ypos equ $c896
; start of vectrex memory with cartridge name...
ORG 0
;***************************************************************************
; HEADER SECTION
;***************************************************************************
ORG 0
; start of vectrex memory with cartridge name...
DB "g GCE 2005", $80 ; 'g' is copyright sign
DW music7 ; music from the rom
DB $F8, $50, -$0, -$70 ; height, width, rel x, rel y (from 0,0)
DB "THE CREEPING MAW", $80 ; some game information, ending with $80
DB 0 ; end of game header
;***************************************************************************;
;CODE SECTION
;***************************************************************************
; here the cartridge program starts off
clra ; Resetting rotation angle
sta rotangle
LDD #$FC20 ; HEIGTH, WIDTH (-4, 32)
STD Vec_Text_HW ; store to BIOS RAM location
LDA #1 ; these set up the joystick
STA Vec_Joy_Mux_1_X ; enquiries
LDA #3 ; allowing only all directions
STA Vec_Joy_Mux_1_Y ; for joystick one
LDA #0 ; this setting up saves a few
STA Vec_Joy_Mux_2_X ; hundred cycles
STA Vec_Joy_Mux_2_Y ; don't miss it, if you don't
; need the second joystick!
main:
main_loop:
JSR Wait_Recal ; Vectrex BIOS recalibration
JSR Intensity_5F ; Sets the intensity of the vector beam to $5f
LDX #PlayerOne ; Load the ship
LDB #9 ; Load number of vectors in the ship
LDA rotangle ; Load rotation angle
LDU #rotated ; I THINK this means save it to register U
jsr ROTVL ; Rotates the co-ordinates
LDA xpos
LDB ypos
jsr Moveto_d_7F ; Move the pen
LDX #rotated ; Rotated vectorlist
LDA #9
jsr Mov_Draw_VL_ab ; Draw
JSR Joy_Digital ; read joystick positions
LDA Vec_Joy_1_X ; load joystick 1 position X to A
BEQ no_x_movement ; if zero, than no x position
BMI left_move ; if negative, than left, otherwise right
right_move:
LDU #joypad_right_string ; display right string
DEC rotangle
BRA x_done ; goto x done
left_move:
LDU #joypad_left_string ; display left string
INC rotangle
BRA x_done ; goto x done
no_x_movement:
LDU #no_joypad_x_string ; display no x string
x_done:
JSR Print_Str_yx ; using string function
LDA Vec_Joy_1_Y ; load joystick 1 position
; Y to A
BEQ no_y_movement ; if zero, than no y position
BMI down_move ; if negative, than down
; otherwise up
up_move:
LDU #joypad_up_string ; display up string
INC ypos
BRA y_done ; goto y done
down_move:
LDU #joypad_down_string ; display down string
INC xpos
BRA y_done ; goto y done
no_y_movement:
LDU #no_joypad_y_string ; display no y string
y_done:
JSR Print_Str_yx ; using string function
BRA main_loop ; and repeat forever
;***************************************************************************
no_joypad_x_string:
DB 40,-50,"NO JOYPAD X INPUT", $80
joypad_right_string:
DB 40,-50,"JOYPAD 1 RIGHT", $80
joypad_left_string:
DB 40,-50,"JOYPAD 1 LEFT", $80
no_joypad_y_string:
DB 20,-50,"NO JOYPAD Y INPUT", $80
joypad_up_string:
DB 20,-50,"JOYPAD 1 UP", $80
joypad_down_string:
DB 20,-50,"JOYPAD 1 DOWN", $80
;***************************************************************************
; Graphics
;***************************************************************************
PlayerOne:
FCB 0x1C,0xF8;
FCB 0xCE,0xFC;
FCB 0x1C,0x08;
FCB 0xDC,0xE8;
FCB 0x14,0x1C;
FCB 0xEC,0x1C;
FCB 0x24,0xE8;
FCB 0xE4,0x08;
FCB 0x32,0xFC;
END main
;***************************************************************************