If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Mole Attack

From The Cutting Room Floor
Jump to navigation Jump to search

Title Screen

Mole Attack

Developer: HAL Laboratory
Publisher: Commodore
Platform: Commodore VIC-20
Released in US: 1981


SourceIcon.png This game has uncompiled source code.


Mole Attack is a historical footnote, in that it is one of the first major whac-a-mole games on computers.

Source Code

Starting around 0xD28 in the cartridge, there's a sizable amount of code.

START 
SEI
CLD
LDX #$FF
TXS
JSR ITINIT      ;INIT I/O PORTS
CLD
SEI
LDA #0 
STA VIA1+$E
LDA #%01111111  ;KILL INTERRUPTS
STA VIA2+$E
LDA #%00000000
STA VIA1+$B 
STA VIA2+$B 
LDA #%11111111
STA VIA2+2 
LDA #%10000000 
STA VIA1+3 
LDX #0
STX VIA1+4
INX
STX VIA1+5
LDA VIA1+$C
AND #%00111111
STA VIA1+$C
;
LDX #15         ;INIT VIC
VICILP LDA VICTBL,X 
STA VIC,X 
DEX )
BPL VICILP 
;
LDX #0          ;INIT ZERO PAGE 
TXA 
ZPINIT STA 0,X 
DEX 
BNE ZPINIT 
;
LDX #0          ;INIT CHARACTERS 
CHINIT LDA CHRTBL,X
STA CHAR,X 
LDA CHRTBL+$100,X 	
STA CHAR+$100,X
LDA CHRTBL+$200,X
STA CHAR+$200,X
LDA CHRTBL+$300,X
STA CHAR+$300,X
DEX 
BNE CHINIT 
;
LDX #0 
CHINT2 LDY #7
CHINT3 LDA $30*8+CHRTBL,X
EOR #$FF
STA $60*8+1+CHRTBL,X 
INX 
DEY
BNE CHINT3
INX
CPX #80 
BNE CHINT2 
;
; 
; 
JMP $AE00       ;TRANSFER TO
;                 TL/1 
VICTBL 
.BYT 3   ; X OFFSET
.BYT 18  ; Y OFFSET 
.BYT 22  ; X WIDTH
.BYT 50  ; Y WIDTH * 2
.BYT 0   ;
.BYT $EC ; 
.BYT 0   ; 
.BYT 0   ; 
.BYT 0   ;
.BYT 0   ;
.BYT 0   ; OSC 1 
.BYT 0   ; OSC 2
.BYT 0   ; OSC 3 
.BYT 0   ; NOISE 
.BYT $00 ; AUX.COL & VOLUME
.BYT $0D ; COLOR(BLACK+GREEN)


(Source: Chris Baird)