diff --git a/crash.s b/crash.a similarity index 72% rename from crash.s rename to crash.a index 931e0fe..d913565 100644 --- a/crash.s +++ b/crash.a @@ -1,10 +1,10 @@ -{ +!zone { lda CRASH - bne nocrash + bne .nocrash lda CXP0FB ora CXP1FB and #$80 - beq nocrash + beq .nocrash lda #8 sta AUDC1 lda #0 @@ -26,44 +26,44 @@ lda CXP0FB and #$80 - beq nocrashp0 + beq .nocrashp0 dec P0LIVES -nowinnerp0: +.nowinnerp0 lda #120 sta Y0_HI lda P0LIVES - bne nocrashp0 + bne .nocrashp0 lda #1 sta RESET -nocrashp0: +.nocrashp0 lda CXP1FB and #$80 - beq nocrashp1 + beq .nocrashp1 dec P1LIVES -nowinnerp1: +.nowinnerp1 lda #120 sta Y1_HI lda P1LIVES - bne nocrashp1 + bne .nocrashp1 lda #1 sta RESET -nocrashp1: +.nocrashp1 lda P0LIVES ora P1LIVES - bne notboth + bne .notboth lda #$50 sta WINNER_COLOR - jmp nocrash -notboth: + jmp .nocrash +.notboth lda P0LIVES - bne checknext + bne .checknext lda #P1COL-10 sta WINNER_COLOR - jmp nocrash -checknext: + jmp .nocrash +.checknext lda P1LIVES - bne nocrash + bne .nocrash lda #P0COL-10 sta WINNER_COLOR -nocrash: +.nocrash } diff --git a/enginesounds.s b/enginesounds.a similarity index 92% rename from enginesounds.s rename to enginesounds.a index efdaa45..4add865 100644 --- a/enginesounds.s +++ b/enginesounds.a @@ -1,4 +1,4 @@ -{ +!zone { tax and #%11001100 beq noblow @@ -12,7 +12,7 @@ lda #2 sta AUDV0 jmp nothrust -noblow: +noblow txa and #$11 beq nothrust @@ -22,5 +22,5 @@ noblow: sta AUDF0 lda #4 sta AUDV0 -nothrust: +nothrust } diff --git a/input.s b/input.a similarity index 76% rename from input.s rename to input.a index 5133991..7dab142 100644 --- a/input.s +++ b/input.a @@ -1,7 +1,7 @@ -.var LSPEED = 9 -.var RSPEED = 0-9 -.var VSPEED = 0-20 -.var GRAVITY = 10 +LSPEED = 9 +RSPEED = 0-9 +VSPEED = 0-20 +GRAVITY = 10 lda CXPPMM and #$80 @@ -10,7 +10,7 @@ ldy JUST_COLLIDED bne input_nocol - // Collision energy transfer + ; Collision energy transfer lda SPEEDX0_LO ldy SPEEDX1_LO sta SPEEDX1_LO @@ -35,11 +35,11 @@ sta JUST_COLLIDED jmp input_nocheck -input_nocol: -{ // player 0 +input_nocol +!zone { ; player 0 txa - and #$10 // Up button - beq noup + and #$10 ; Up button + beq .noup clc lda SPEEDY0_LO adc #VSPEED sta SPEEDY0_HI -noup: +.noup txa - and #$80 // Right button - beq nor + and #$80 ; Right button + beq .nor clc lda SPEEDX0_LO adc #RSPEED sta SPEEDX0_HI - jmp nohor + jmp .nohor -nor: +.nor txa - and #$40 // Left button - beq nohor + and #$40 ; Left button + beq .nohor clc lda SPEEDX0_LO adc #LSPEED sta SPEEDX0_HI -nohor: +.nohor } -{ // player 1 +!zone { ; player 1 txa - and #1 // Up button - beq noup + and #1 ; Up button + beq .noup clc lda SPEEDY1_LO adc #VSPEED sta SPEEDY1_HI -noup: +.noup txa - and #8 // Right button - beq nor + and #8 ; Right button + beq .nor clc lda SPEEDX1_LO adc #RSPEED sta SPEEDX1_HI - jmp nohor + jmp .nohor -nor: +.nor txa - and #4 // Left button - beq nohor + and #4 ; Left button + beq .nohor clc lda SPEEDX1_LO adc #LSPEED sta SPEEDX1_HI -nohor: +.nohor } -input_nocheck: +input_nocheck sta CXCLR -{ // Gravity p0 +; Gravity p0 clc lda SPEEDY0_LO adc #GRAVITY sta SPEEDY0_HI -} -{ // Gravity p1 +; Gravity p1 clc lda SPEEDY1_LO adc #GRAVITY sta SPEEDY1_HI -} - diff --git a/game.s b/jsumo.a similarity index 60% rename from game.s rename to jsumo.a index e342547..ec16ed2 100644 --- a/game.s +++ b/jsumo.a @@ -1,79 +1,83 @@ -.import source "vcs/pal.s" - -.pseudocommand nop x { - .for (var i=0; i wait for leading edge of horizontal blank -03 RSYNC reset horizontal sync counter -04 NUSIZ0 ..111111 number-size player-missile 0 -05 NUSIZ1 ..111111 number-size player-missile 1 -06 COLUP0 1111111. color-lum player 0 and missile 0 -07 COLUP1 1111111. color-lum player 1 and missile 1 -08 COLUPF 1111111. color-lum playfield and ball -09 COLUBK 1111111. color-lum background -0A CTRLPF ..11.111 control playfield ball size & collisions -0B REFP0 ....1... reflect player 0 -0C REFP1 ....1... reflect player 1 -0D PF0 1111.... playfield register byte 0 -0E PF1 11111111 playfield register byte 1 -0F PF2 11111111 playfield register byte 2 -10 RESP0 reset player 0 -11 RESP1 reset player 1 -12 RESM0 reset missile 0 -13 RESM1 reset missile 1 -14 RESBL reset ball -15 AUDC0 ....1111 audio control 0 -16 AUDC1 ....1111 audio control 1 -17 AUDF0 ...11111 audio frequency 0 -18 AUDF1 ...11111 audio frequency 1 -19 AUDV0 ....1111 audio volume 0 -1A AUDV1 ....1111 audio volume 1 -1B GRP0 11111111 graphics player 0 -1C GRP1 11111111 graphics player 1 -1D ENAM0 ......1. graphics (enable) missile 0 -1E ENAM1 ......1. graphics (enable) missile 1 -1F ENABL ......1. graphics (enable) ball -20 HMP0 1111.... horizontal motion player 0 -21 HMP1 1111.... horizontal motion player 1 -22 HMM0 1111.... horizontal motion missile 0 -23 HMM1 1111.... horizontal motion missile 1 -24 HMBL 1111.... horizontal motion ball -25 VDELP0 .......1 vertical delay player 0 -26 VDELP1 .......1 vertical delay player 1 -27 VDELBL .......1 vertical delay ball -28 RESMP0 ......1. reset missile 0 to player 0 -29 RESMP1 ......1. reset missile 1 to player 1 -2A HMOVE apply horizontal motion -2B HMCLR clear horizontal motion registers -2C CXCLR clear collision latches -30 CXM0P 11...... read collision M0-P1, M0-P0 (Bit 7,6) -31 CXM1P 11...... read collision M1-P0, M1-P1 -32 CXP0FB 11...... read collision P0-PF, P0-BL -33 CXP1FB 11...... read collision P1-PF, P1-BL -34 CXM0FB 11...... read collision M0-PF, M0-BL -35 CXM1FB 11...... read collision M1-PF, M1-BL -36 CXBLPF 1....... read collision BL-PF, unused -37 CXPPMM 11...... read collision P0-P1, M0-M1 -38 INPT0 1....... read pot port -39 INPT1 1....... read pot port -3A INPT2 1....... read pot port -3B INPT3 1....... read pot port -3C INPT4 1....... read input -3D INPT5 1....... read input -0280 SWCHA 11111111 Port A; input or output (read or write) -0281 SWACNT 11111111 Port A DDR, 0= input, 1=output -0282 SWCHB 11111111 Port B; console switches (read only) -0283 SWBCNT 11111111 Port B DDR (hardwired as input) -0284 INTIM 11111111 Timer output (read only) -0285 INSTAT 11...... Timer Status (read only, undocumented) -0294 TIM1T 11111111 set 1 clock interval (838 nsec/interval) -0295 TIM8T 11111111 set 8 clock interval (6.7 usec/interval) -0296 TIM64T 11111111 set 64 clock interval (53.6 usec/interval) -0297 T1024T 11111111 set 1024 clock interval (858.2 usec/interval) -''' - -for line in info.split('\n'): - if not line.strip(): - continue - location, name, _ = line.split(None, 2) - print '.var %s = $%s' % (name, location) diff --git a/vcs/vcs.s b/vcs/vcs.s deleted file mode 100644 index 4d2d470..0000000 --- a/vcs/vcs.s +++ /dev/null @@ -1,58 +0,0 @@ -.var VBLANK_TIMER = VBLANK_LINES*75/64 -.var OVERSCAN_TIMER = OVERSCAN_LINES*75/64 - -.import source "regs.s" - -.macro VSync() { - lda #2 - sta VSYNC - sta WSYNC - sta WSYNC - sta WSYNC - lda #0 - sta VSYNC - sta WSYNC -} - -.macro VBlankBegin() { - lda #VBLANK_TIMER - sta TIM64T -} - -.macro VBlankEnd() { -wait: - lda TIM64T - bne wait - sta WSYNC - lda #0 - sta VBLANK -} - -.macro OverscanBegin() { - sta WSYNC - lda #2 - sta VBLANK - lda #OVERSCAN_TIMER - sta TIM64T - sta WSYNC -} - -.macro OverscanEnd() { -wait: - lda TIM64T - bne wait - sta WSYNC -} - -.pc=$f000 -init: - sei - cld - ldx #$ff - txs - inx - lda #0 -clr: - sta 0,x - dex - bne clr diff --git a/vcs/vectors.s b/vcs/vectors.s deleted file mode 100644 index 4a52513..0000000 --- a/vcs/vectors.s +++ /dev/null @@ -1,3 +0,0 @@ -.pc=$f7fc -.word init -.word init