------- FILE c:\bB\FlagCarRacing.bas.asm LEVEL 1 PASS 2 1 2ffe processor 6502 ------- FILE vcs.h LEVEL 2 PASS 2 0 3000 ???? include "vcs.h" 1 3000 ???? ; VCS.H 2 3000 ???? ; Version 1.05, 13/November/2003 3 3000 ???? 4 3000 ???? 00 69 VERSION_VCS = 105 5 3000 ???? 6 3000 ???? ; THIS IS A PRELIMINARY RELEASE OF *THE* "STANDARD" VCS.H 7 3000 ???? ; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE 8 3000 ???? ; PLEASE DO *NOT* REDISTRIBUTE THIS FILE! 9 3000 ???? ; 10 3000 ???? ; This file defines hardware registers and memory mapping for the 11 3000 ???? ; Atari 2600. It is distributed as a companion machine-specific support package 12 3000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 13 3000 ???? ; available at at http://www.atari2600.org/dasm 14 3000 ???? ; 15 3000 ???? ; Many thanks to the original author(s) of this file, and to everyone who has 16 3000 ???? ; contributed to understanding the Atari 2600. If you take issue with the 17 3000 ???? ; contents, or naming of registers, please write to me (atari2600@taswegian.com) 18 3000 ???? ; with your views. Please contribute, if you think you can improve this 19 3000 ???? ; file! 20 3000 ???? ; 21 3000 ???? ; Latest Revisions... 22 3000 ???? ; 1.05 13/NOV/2003 - Correction to 1.04 - now functions as requested by MR. 23 3000 ???? ; - Added VERSION_VCS equate (which will reflect 100x version #) 24 3000 ???? ; This will allow conditional code to verify VCS.H being 25 3000 ???? ; used for code assembly. 26 3000 ???? ; 1.04 12/NOV/2003 Added TIA_BASE_WRITE_ADDRESS and TIA_BASE_READ_ADDRESS for 27 3000 ???? ; convenient disassembly/reassembly compatibility for hardware 28 3000 ???? ; mirrored reading/writing differences. This is more a 29 3000 ???? ; readability issue, and binary compatibility with disassembled 30 3000 ???? ; and reassembled sources. Per Manuel Rotschkar's suggestion. 31 3000 ???? ; 1.03 12/MAY/2003 Added SEG segment at end of file to fix old-code compatibility 32 3000 ???? ; which was broken by the use of segments in this file, as 33 3000 ???? ; reported by Manuel Polik on [stella] 11/MAY/2003 34 3000 ???? ; 1.02 22/MAR/2003 Added TIMINT($285) 35 3000 ???? ; 1.01 Constant offset added to allow use for 3F-style bankswitching 36 3000 ???? ; - define TIA_BASE_ADDRESS as $40 for Tigervision carts, otherwise 37 3000 ???? ; it is safe to leave it undefined, and the base address will 38 3000 ???? ; be set to 0. Thanks to Eckhard Stolberg for the suggestion. 39 3000 ???? ; Note, may use -DLABEL=EXPRESSION to define TIA_BASE_ADDRESS 40 3000 ???? ; - register definitions are now generated through assignment 41 3000 ???? ; in uninitialised segments. This allows a changeable base 42 3000 ???? ; address architecture. 43 3000 ???? ; 1.0 22/MAR/2003 Initial release 44 3000 ???? 45 3000 ???? 46 3000 ???? ;------------------------------------------------------------------------------- 47 3000 ???? 48 3000 ???? ; TIA_BASE_ADDRESS 49 3000 ???? ; The TIA_BASE_ADDRESS defines the base address of access to TIA registers. 50 3000 ???? ; Normally 0, the base address should (externally, before including this file) 51 3000 ???? ; be set to $40 when creating 3F-bankswitched (and other?) cartridges. 52 3000 ???? ; The reason is that this bankswitching scheme treats any access to locations 53 3000 ???? ; < $40 as a bankswitch. 54 3000 ???? 55 3000 ???? - IFNCONST TIA_BASE_ADDRESS 56 3000 ???? -TIA_BASE_ADDRESS = 0 57 3000 ???? ENDIF 58 3000 ???? 59 3000 ???? ; Note: The address may be defined on the command-line using the -D switch, eg: 60 3000 ???? ; dasm.exe code.asm -DTIA_BASE_ADDRESS=$40 -f3 -v5 -ocode.bin 61 3000 ???? ; *OR* by declaring the label before including this file, eg: 62 3000 ???? ; TIA_BASE_ADDRESS = $40 63 3000 ???? ; include "vcs.h" 64 3000 ???? 65 3000 ???? ; Alternate read/write address capability - allows for some disassembly compatibility 66 3000 ???? ; usage ; to allow reassembly to binary perfect copies). This is essentially catering 67 3000 ???? ; for the mirrored ROM hardware registers. 68 3000 ???? 69 3000 ???? ; Usage: As per above, define the TIA_BASE_READ_ADDRESS and/or TIA_BASE_WRITE_ADDRESS 70 3000 ???? ; using the -D command-line switch, as required. If the addresses are not defined, 71 3000 ???? ; they defaut to the TIA_BASE_ADDRESS. 72 3000 ???? 73 3000 ???? - IFNCONST TIA_BASE_READ_ADDRESS 74 3000 ???? -TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS 75 3000 ???? ENDIF 76 3000 ???? 77 3000 ???? - IFNCONST TIA_BASE_WRITE_ADDRESS 78 3000 ???? -TIA_BASE_WRITE_ADDRESS = TIA_BASE_ADDRESS 79 3000 ???? ENDIF 80 3000 ???? 81 3000 ???? ;------------------------------------------------------------------------------- 82 3000 ???? 83 U002d ???? SEG.U TIA_REGISTERS_WRITE 84 U0000 ORG TIA_BASE_WRITE_ADDRESS 85 U0000 86 U0000 ; DO NOT CHANGE THE RELATIVE ORDERING OF REGISTERS! 87 U0000 88 U0000 00 VSYNC ds 1 ; $00 0000 00x0 Vertical Sync Set-Clear 89 U0001 00 VBLANK ds 1 ; $01 xx00 00x0 Vertical Blank Set-Clear 90 U0002 00 WSYNC ds 1 ; $02 ---- ---- Wait for Horizontal Blank 91 U0003 00 RSYNC ds 1 ; $03 ---- ---- Reset Horizontal Sync Counter 92 U0004 00 NUSIZ0 ds 1 ; $04 00xx 0xxx Number-Size player/missle 0 93 U0005 00 NUSIZ1 ds 1 ; $05 00xx 0xxx Number-Size player/missle 1 94 U0006 00 COLUP0 ds 1 ; $06 xxxx xxx0 Color-Luminance Player 0 95 U0007 00 COLUP1 ds 1 ; $07 xxxx xxx0 Color-Luminance Player 1 96 U0008 00 COLUPF ds 1 ; $08 xxxx xxx0 Color-Luminance Playfield 97 U0009 00 COLUBK ds 1 ; $09 xxxx xxx0 Color-Luminance Background 98 U000a 00 CTRLPF ds 1 ; $0A 00xx 0xxx Control Playfield, Ball, Collisions 99 U000b 00 REFP0 ds 1 ; $0B 0000 x000 Reflection Player 0 100 U000c 00 REFP1 ds 1 ; $0C 0000 x000 Reflection Player 1 101 U000d 00 PF0 ds 1 ; $0D xxxx 0000 Playfield Register Byte 0 102 U000e 00 PF1 ds 1 ; $0E xxxx xxxx Playfield Register Byte 1 103 U000f 00 PF2 ds 1 ; $0F xxxx xxxx Playfield Register Byte 2 104 U0010 00 RESP0 ds 1 ; $10 ---- ---- Reset Player 0 105 U0011 00 RESP1 ds 1 ; $11 ---- ---- Reset Player 1 106 U0012 00 RESM0 ds 1 ; $12 ---- ---- Reset Missle 0 107 U0013 00 RESM1 ds 1 ; $13 ---- ---- Reset Missle 1 108 U0014 00 RESBL ds 1 ; $14 ---- ---- Reset Ball 109 U0015 00 AUDC0 ds 1 ; $15 0000 xxxx Audio Control 0 110 U0016 00 AUDC1 ds 1 ; $16 0000 xxxx Audio Control 1 111 U0017 00 AUDF0 ds 1 ; $17 000x xxxx Audio Frequency 0 112 U0018 00 AUDF1 ds 1 ; $18 000x xxxx Audio Frequency 1 113 U0019 00 AUDV0 ds 1 ; $19 0000 xxxx Audio Volume 0 114 U001a 00 AUDV1 ds 1 ; $1A 0000 xxxx Audio Volume 1 115 U001b 00 GRP0 ds 1 ; $1B xxxx xxxx Graphics Register Player 0 116 U001c 00 GRP1 ds 1 ; $1C xxxx xxxx Graphics Register Player 1 117 U001d 00 ENAM0 ds 1 ; $1D 0000 00x0 Graphics Enable Missle 0 118 U001e 00 ENAM1 ds 1 ; $1E 0000 00x0 Graphics Enable Missle 1 119 U001f 00 ENABL ds 1 ; $1F 0000 00x0 Graphics Enable Ball 120 U0020 00 HMP0 ds 1 ; $20 xxxx 0000 Horizontal Motion Player 0 121 U0021 00 HMP1 ds 1 ; $21 xxxx 0000 Horizontal Motion Player 1 122 U0022 00 HMM0 ds 1 ; $22 xxxx 0000 Horizontal Motion Missle 0 123 U0023 00 HMM1 ds 1 ; $23 xxxx 0000 Horizontal Motion Missle 1 124 U0024 00 HMBL ds 1 ; $24 xxxx 0000 Horizontal Motion Ball 125 U0025 00 VDELP0 ds 1 ; $25 0000 000x Vertical Delay Player 0 126 U0026 00 VDELP1 ds 1 ; $26 0000 000x Vertical Delay Player 1 127 U0027 00 VDELBL ds 1 ; $27 0000 000x Vertical Delay Ball 128 U0028 00 RESMP0 ds 1 ; $28 0000 00x0 Reset Missle 0 to Player 0 129 U0029 00 RESMP1 ds 1 ; $29 0000 00x0 Reset Missle 1 to Player 1 130 U002a 00 HMOVE ds 1 ; $2A ---- ---- Apply Horizontal Motion 131 U002b 00 HMCLR ds 1 ; $2B ---- ---- Clear Horizontal Move Registers 132 U002c 00 CXCLR ds 1 ; $2C ---- ---- Clear Collision Latches 133 U002d 134 U002d ;------------------------------------------------------------------------------- 135 U002d 136 U000e ???? SEG.U TIA_REGISTERS_READ 137 U0000 ORG TIA_BASE_READ_ADDRESS 138 U0000 139 U0000 ; bit 7 bit 6 140 U0000 00 CXM0P ds 1 ; $00 xx00 0000 Read Collision M0-P1 M0-P0 141 U0001 00 CXM1P ds 1 ; $01 xx00 0000 M1-P0 M1-P1 142 U0002 00 CXP0FB ds 1 ; $02 xx00 0000 P0-PF P0-BL 143 U0003 00 CXP1FB ds 1 ; $03 xx00 0000 P1-PF P1-BL 144 U0004 00 CXM0FB ds 1 ; $04 xx00 0000 M0-PF M0-BL 145 U0005 00 CXM1FB ds 1 ; $05 xx00 0000 M1-PF M1-BL 146 U0006 00 CXBLPF ds 1 ; $06 x000 0000 BL-PF ----- 147 U0007 00 CXPPMM ds 1 ; $07 xx00 0000 P0-P1 M0-M1 148 U0008 00 INPT0 ds 1 ; $08 x000 0000 Read Pot Port 0 149 U0009 00 INPT1 ds 1 ; $09 x000 0000 Read Pot Port 1 150 U000a 00 INPT2 ds 1 ; $0A x000 0000 Read Pot Port 2 151 U000b 00 INPT3 ds 1 ; $0B x000 0000 Read Pot Port 3 152 U000c 00 INPT4 ds 1 ; $0C x000 0000 Read Input (Trigger) 0 153 U000d 00 INPT5 ds 1 ; $0D x000 0000 Read Input (Trigger) 1 154 U000e 155 U000e ;------------------------------------------------------------------------------- 156 U000e 157 U0298 ???? SEG.U RIOT 158 U0280 ORG $280 159 U0280 160 U0280 ; RIOT MEMORY MAP 161 U0280 162 U0280 00 SWCHA ds 1 ; $280 Port A data register for joysticks: 163 U0281 ; Bits 4-7 for player 1. Bits 0-3 for player 2. 164 U0281 165 U0281 00 SWACNT ds 1 ; $281 Port A data direction register (DDR) 166 U0282 00 SWCHB ds 1 ; $282 Port B data (console switches) 167 U0283 00 SWBCNT ds 1 ; $283 Port B DDR 168 U0284 00 INTIM ds 1 ; $284 Timer output 169 U0285 170 U0285 00 TIMINT ds 1 ; $285 171 U0286 172 U0286 ; Unused/undefined registers ($285-$294) 173 U0286 174 U0286 00 ds 1 ; $286 175 U0287 00 ds 1 ; $287 176 U0288 00 ds 1 ; $288 177 U0289 00 ds 1 ; $289 178 U028a 00 ds 1 ; $28A 179 U028b 00 ds 1 ; $28B 180 U028c 00 ds 1 ; $28C 181 U028d 00 ds 1 ; $28D 182 U028e 00 ds 1 ; $28E 183 U028f 00 ds 1 ; $28F 184 U0290 00 ds 1 ; $290 185 U0291 00 ds 1 ; $291 186 U0292 00 ds 1 ; $292 187 U0293 00 ds 1 ; $293 188 U0294 189 U0294 00 TIM1T ds 1 ; $294 set 1 clock interval 190 U0295 00 TIM8T ds 1 ; $295 set 8 clock interval 191 U0296 00 TIM64T ds 1 ; $296 set 64 clock interval 192 U0297 00 T1024T ds 1 ; $297 set 1024 clock interval 193 U0298 194 U0298 ;------------------------------------------------------------------------------- 195 U0298 ; The following required for back-compatibility with code which does not use 196 U0298 ; segments. 197 U0298 198 3000 ???? SEG 199 3000 ???? 200 3000 ???? ; EOF ------- FILE c:\bB\FlagCarRacing.bas.asm ------- FILE macro.h LEVEL 2 PASS 2 0 3000 ???? include "macro.h" 1 3000 ???? ; MACRO.H 2 3000 ???? ; Version 1.05, 13/NOVEMBER/2003 3 3000 ???? 4 3000 ???? 00 69 VERSION_MACRO = 105 5 3000 ???? 6 3000 ???? ; 7 3000 ???? ; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE 8 3000 ???? ; PLEASE DO *NOT* REDISTRIBUTE MODIFIED VERSIONS OF THIS FILE! 9 3000 ???? ; 10 3000 ???? ; This file defines DASM macros useful for development for the Atari 2600. 11 3000 ???? ; It is distributed as a companion machine-specific support package 12 3000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 13 3000 ???? ; available at at http://www.atari2600.org/dasm 14 3000 ???? ; 15 3000 ???? ; Many thanks to the people who have contributed. If you take issue with the 16 3000 ???? ; contents, or would like to add something, please write to me 17 3000 ???? ; (atari2600@taswegian.com) with your contribution. 18 3000 ???? ; 19 3000 ???? ; Latest Revisions... 20 3000 ???? ; 21 3000 ???? ; 1.05 14/NOV/2003 - Added VERSION_MACRO equate (which will reflect 100x version #) 22 3000 ???? ; This will allow conditional code to verify MACRO.H being 23 3000 ???? ; used for code assembly. 24 3000 ???? ; 1.04 13/NOV/2003 - SET_POINTER macro added (16-bit address load) 25 3000 ???? ; 26 3000 ???? ; 1.03 23/JUN/2003 - CLEAN_START macro added - clears TIA, RAM, registers 27 3000 ???? ; 28 3000 ???? ; 1.02 14/JUN/2003 - VERTICAL_SYNC macro added 29 3000 ???? ; (standardised macro for vertical synch code) 30 3000 ???? ; 1.01 22/MAR/2003 - SLEEP macro added. 31 3000 ???? ; - NO_ILLEGAL_OPCODES switch implemented 32 3000 ???? ; 1.0 22/MAR/2003 Initial release 33 3000 ???? 34 3000 ???? ; Note: These macros use illegal opcodes. To disable illegal opcode usage, 35 3000 ???? ; define the symbol NO_ILLEGAL_OPCODES (-DNO_ILLEGAL_OPCODES=1 on command-line). 36 3000 ???? ; If you do not allow illegal opcode usage, you must include this file 37 3000 ???? ; *after* including VCS.H (as the non-illegal opcodes access hardware 38 3000 ???? ; registers and require them to be defined first). 39 3000 ???? 40 3000 ???? ; Available macros... 41 3000 ???? ; SLEEP n - sleep for n cycles 42 3000 ???? ; VERTICAL_SYNC - correct 3 scanline vertical synch code 43 3000 ???? ; CLEAN_START - set machine to known state on startup 44 3000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable 45 3000 ???? 46 3000 ???? ;------------------------------------------------------------------------------- 47 3000 ???? ; SLEEP duration 48 3000 ???? ; Original author: Thomas Jentzsch 49 3000 ???? ; Inserts code which takes the specified number of cycles to execute. This is 50 3000 ???? ; useful for code where precise timing is required. 51 3000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS. 52 3000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS 53 3000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards). 54 3000 ???? 55 3000 ???? MAC sleep 56 3000 ???? .CYCLES SET {1} 57 3000 ???? 58 3000 ???? IF .CYCLES < 2 59 3000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 60 3000 ???? ERR 61 3000 ???? ENDIF 62 3000 ???? 63 3000 ???? IF .CYCLES & 1 64 3000 ???? IFNCONST NO_ILLEGAL_OPCODES 65 3000 ???? nop 0 66 3000 ???? ELSE 67 3000 ???? bit VSYNC 68 3000 ???? ENDIF 69 3000 ???? .CYCLES SET .CYCLES - 3 70 3000 ???? ENDIF 71 3000 ???? 72 3000 ???? REPEAT .CYCLES / 2 73 3000 ???? nop 74 3000 ???? REPEND 75 3000 ???? ENDM ;usage: SLEEP n (n>1) 76 3000 ???? 77 3000 ???? ;------------------------------------------------------------------------------- 78 3000 ???? ; VERTICAL_SYNC 79 3000 ???? ; Original author: Manuel Polik 80 3000 ???? ; Inserts the code required for a proper 3 scannline 81 3000 ???? ; vertical sync sequence 82 3000 ???? ; 83 3000 ???? ; Note: Alters the accumulator 84 3000 ???? ; 85 3000 ???? ; IN: 86 3000 ???? ; OUT: A = 1 87 3000 ???? 88 3000 ???? MAC vertical_sync 89 3000 ???? LDA #$02 ; A = VSYNC enable 90 3000 ???? STA WSYNC ; Finish current line 91 3000 ???? STA VSYNC ; Start vertical sync 92 3000 ???? STA WSYNC ; 1st line vertical sync 93 3000 ???? STA WSYNC ; 2nd line vertical sync 94 3000 ???? LSR ; A = VSYNC disable 95 3000 ???? STA WSYNC ; 3rd line vertical sync 96 3000 ???? STA VSYNC ; Stop vertical sync 97 3000 ???? ENDM 98 3000 ???? 99 3000 ???? ;------------------------------------------------------------------------------- 100 3000 ???? ; CLEAN_START 101 3000 ???? ; Original author: Andrew Davie 102 3000 ???? ; Standardised start-up code, clears stack, all TIA registers and RAM to 0 103 3000 ???? ; Sets stack pointer to $FF, and all registers to 0 104 3000 ???? ; Sets decimal mode off, sets interrupt flag (kind of un-necessary) 105 3000 ???? ; Use as very first section of code on boot (ie: at reset) 106 3000 ???? ; Code written to minimise total ROM usage - uses weird 6502 knowledge :) 107 3000 ???? 108 3000 ???? MAC clean_start 109 3000 ???? sei 110 3000 ???? cld 111 3000 ???? 112 3000 ???? ldx #0 113 3000 ???? txa 114 3000 ???? tay 115 3000 ???? .CLEAR_STACK dex 116 3000 ???? txs 117 3000 ???? pha 118 3000 ???? bne .CLEAR_STACK ; SP=$FF, X = A = Y = 0 119 3000 ???? 120 3000 ???? ENDM 121 3000 ???? 122 3000 ???? ;------------------------------------------------------- 123 3000 ???? ; SET_POINTER 124 3000 ???? ; Original author: Manuel Rotschkar 125 3000 ???? ; 126 3000 ???? ; Sets a 2 byte RAM pointer to an absolute address. 127 3000 ???? ; 128 3000 ???? ; Usage: SET_POINTER pointer, address 129 3000 ???? ; Example: SET_POINTER SpritePTR, SpriteData 130 3000 ???? ; 131 3000 ???? ; Note: Alters the accumulator, NZ flags 132 3000 ???? ; IN 1: 2 byte RAM location reserved for pointer 133 3000 ???? ; IN 2: absolute address 134 3000 ???? 135 3000 ???? MAC set_pointer 136 3000 ???? .POINTER SET {1} 137 3000 ???? .ADDRESS SET {2} 138 3000 ???? 139 3000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address 140 3000 ???? STA .POINTER ; Store in pointer 141 3000 ???? LDA #>.ADDRESS ; Get Hibyte of Address 142 3000 ???? STA .POINTER+1 ; Store in pointer+1 143 3000 ???? 144 3000 ???? ENDM 145 3000 ???? 146 3000 ???? ; EOF ------- FILE c:\bB\FlagCarRacing.bas.asm ------- FILE 2600basic.h LEVEL 2 PASS 2 0 3000 ???? include "2600basic.h" 1 3000 ???? processor 6502 ------- FILE vcs.h LEVEL 3 PASS 2 0 3000 ???? include "vcs.h" 1 3000 ???? ; VCS.H 2 3000 ???? ; Version 1.05, 13/November/2003 3 3000 ???? 4 3000 ???? 00 69 VERSION_VCS = 105 5 3000 ???? 6 3000 ???? ; THIS IS A PRELIMINARY RELEASE OF *THE* "STANDARD" VCS.H 7 3000 ???? ; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE 8 3000 ???? ; PLEASE DO *NOT* REDISTRIBUTE THIS FILE! 9 3000 ???? ; 10 3000 ???? ; This file defines hardware registers and memory mapping for the 11 3000 ???? ; Atari 2600. It is distributed as a companion machine-specific support package 12 3000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 13 3000 ???? ; available at at http://www.atari2600.org/dasm 14 3000 ???? ; 15 3000 ???? ; Many thanks to the original author(s) of this file, and to everyone who has 16 3000 ???? ; contributed to understanding the Atari 2600. If you take issue with the 17 3000 ???? ; contents, or naming of registers, please write to me (atari2600@taswegian.com) 18 3000 ???? ; with your views. Please contribute, if you think you can improve this 19 3000 ???? ; file! 20 3000 ???? ; 21 3000 ???? ; Latest Revisions... 22 3000 ???? ; 1.05 13/NOV/2003 - Correction to 1.04 - now functions as requested by MR. 23 3000 ???? ; - Added VERSION_VCS equate (which will reflect 100x version #) 24 3000 ???? ; This will allow conditional code to verify VCS.H being 25 3000 ???? ; used for code assembly. 26 3000 ???? ; 1.04 12/NOV/2003 Added TIA_BASE_WRITE_ADDRESS and TIA_BASE_READ_ADDRESS for 27 3000 ???? ; convenient disassembly/reassembly compatibility for hardware 28 3000 ???? ; mirrored reading/writing differences. This is more a 29 3000 ???? ; readability issue, and binary compatibility with disassembled 30 3000 ???? ; and reassembled sources. Per Manuel Rotschkar's suggestion. 31 3000 ???? ; 1.03 12/MAY/2003 Added SEG segment at end of file to fix old-code compatibility 32 3000 ???? ; which was broken by the use of segments in this file, as 33 3000 ???? ; reported by Manuel Polik on [stella] 11/MAY/2003 34 3000 ???? ; 1.02 22/MAR/2003 Added TIMINT($285) 35 3000 ???? ; 1.01 Constant offset added to allow use for 3F-style bankswitching 36 3000 ???? ; - define TIA_BASE_ADDRESS as $40 for Tigervision carts, otherwise 37 3000 ???? ; it is safe to leave it undefined, and the base address will 38 3000 ???? ; be set to 0. Thanks to Eckhard Stolberg for the suggestion. 39 3000 ???? ; Note, may use -DLABEL=EXPRESSION to define TIA_BASE_ADDRESS 40 3000 ???? ; - register definitions are now generated through assignment 41 3000 ???? ; in uninitialised segments. This allows a changeable base 42 3000 ???? ; address architecture. 43 3000 ???? ; 1.0 22/MAR/2003 Initial release 44 3000 ???? 45 3000 ???? 46 3000 ???? ;------------------------------------------------------------------------------- 47 3000 ???? 48 3000 ???? ; TIA_BASE_ADDRESS 49 3000 ???? ; The TIA_BASE_ADDRESS defines the base address of access to TIA registers. 50 3000 ???? ; Normally 0, the base address should (externally, before including this file) 51 3000 ???? ; be set to $40 when creating 3F-bankswitched (and other?) cartridges. 52 3000 ???? ; The reason is that this bankswitching scheme treats any access to locations 53 3000 ???? ; < $40 as a bankswitch. 54 3000 ???? 55 3000 ???? - IFNCONST TIA_BASE_ADDRESS 56 3000 ???? -TIA_BASE_ADDRESS = 0 57 3000 ???? ENDIF 58 3000 ???? 59 3000 ???? ; Note: The address may be defined on the command-line using the -D switch, eg: 60 3000 ???? ; dasm.exe code.asm -DTIA_BASE_ADDRESS=$40 -f3 -v5 -ocode.bin 61 3000 ???? ; *OR* by declaring the label before including this file, eg: 62 3000 ???? ; TIA_BASE_ADDRESS = $40 63 3000 ???? ; include "vcs.h" 64 3000 ???? 65 3000 ???? ; Alternate read/write address capability - allows for some disassembly compatibility 66 3000 ???? ; usage ; to allow reassembly to binary perfect copies). This is essentially catering 67 3000 ???? ; for the mirrored ROM hardware registers. 68 3000 ???? 69 3000 ???? ; Usage: As per above, define the TIA_BASE_READ_ADDRESS and/or TIA_BASE_WRITE_ADDRESS 70 3000 ???? ; using the -D command-line switch, as required. If the addresses are not defined, 71 3000 ???? ; they defaut to the TIA_BASE_ADDRESS. 72 3000 ???? 73 3000 ???? - IFNCONST TIA_BASE_READ_ADDRESS 74 3000 ???? -TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS 75 3000 ???? ENDIF 76 3000 ???? 77 3000 ???? - IFNCONST TIA_BASE_WRITE_ADDRESS 78 3000 ???? -TIA_BASE_WRITE_ADDRESS = TIA_BASE_ADDRESS 79 3000 ???? ENDIF 80 3000 ???? 81 3000 ???? ;------------------------------------------------------------------------------- 82 3000 ???? 83 U002d SEG.U TIA_REGISTERS_WRITE 84 U0000 ORG TIA_BASE_WRITE_ADDRESS 85 U0000 86 U0000 ; DO NOT CHANGE THE RELATIVE ORDERING OF REGISTERS! 87 U0000 88 U0000 00 VSYNC ds 1 ; $00 0000 00x0 Vertical Sync Set-Clear 89 U0001 00 VBLANK ds 1 ; $01 xx00 00x0 Vertical Blank Set-Clear 90 U0002 00 WSYNC ds 1 ; $02 ---- ---- Wait for Horizontal Blank 91 U0003 00 RSYNC ds 1 ; $03 ---- ---- Reset Horizontal Sync Counter 92 U0004 00 NUSIZ0 ds 1 ; $04 00xx 0xxx Number-Size player/missle 0 93 U0005 00 NUSIZ1 ds 1 ; $05 00xx 0xxx Number-Size player/missle 1 94 U0006 00 COLUP0 ds 1 ; $06 xxxx xxx0 Color-Luminance Player 0 95 U0007 00 COLUP1 ds 1 ; $07 xxxx xxx0 Color-Luminance Player 1 96 U0008 00 COLUPF ds 1 ; $08 xxxx xxx0 Color-Luminance Playfield 97 U0009 00 COLUBK ds 1 ; $09 xxxx xxx0 Color-Luminance Background 98 U000a 00 CTRLPF ds 1 ; $0A 00xx 0xxx Control Playfield, Ball, Collisions 99 U000b 00 REFP0 ds 1 ; $0B 0000 x000 Reflection Player 0 100 U000c 00 REFP1 ds 1 ; $0C 0000 x000 Reflection Player 1 101 U000d 00 PF0 ds 1 ; $0D xxxx 0000 Playfield Register Byte 0 102 U000e 00 PF1 ds 1 ; $0E xxxx xxxx Playfield Register Byte 1 103 U000f 00 PF2 ds 1 ; $0F xxxx xxxx Playfield Register Byte 2 104 U0010 00 RESP0 ds 1 ; $10 ---- ---- Reset Player 0 105 U0011 00 RESP1 ds 1 ; $11 ---- ---- Reset Player 1 106 U0012 00 RESM0 ds 1 ; $12 ---- ---- Reset Missle 0 107 U0013 00 RESM1 ds 1 ; $13 ---- ---- Reset Missle 1 108 U0014 00 RESBL ds 1 ; $14 ---- ---- Reset Ball 109 U0015 00 AUDC0 ds 1 ; $15 0000 xxxx Audio Control 0 110 U0016 00 AUDC1 ds 1 ; $16 0000 xxxx Audio Control 1 111 U0017 00 AUDF0 ds 1 ; $17 000x xxxx Audio Frequency 0 112 U0018 00 AUDF1 ds 1 ; $18 000x xxxx Audio Frequency 1 113 U0019 00 AUDV0 ds 1 ; $19 0000 xxxx Audio Volume 0 114 U001a 00 AUDV1 ds 1 ; $1A 0000 xxxx Audio Volume 1 115 U001b 00 GRP0 ds 1 ; $1B xxxx xxxx Graphics Register Player 0 116 U001c 00 GRP1 ds 1 ; $1C xxxx xxxx Graphics Register Player 1 117 U001d 00 ENAM0 ds 1 ; $1D 0000 00x0 Graphics Enable Missle 0 118 U001e 00 ENAM1 ds 1 ; $1E 0000 00x0 Graphics Enable Missle 1 119 U001f 00 ENABL ds 1 ; $1F 0000 00x0 Graphics Enable Ball 120 U0020 00 HMP0 ds 1 ; $20 xxxx 0000 Horizontal Motion Player 0 121 U0021 00 HMP1 ds 1 ; $21 xxxx 0000 Horizontal Motion Player 1 122 U0022 00 HMM0 ds 1 ; $22 xxxx 0000 Horizontal Motion Missle 0 123 U0023 00 HMM1 ds 1 ; $23 xxxx 0000 Horizontal Motion Missle 1 124 U0024 00 HMBL ds 1 ; $24 xxxx 0000 Horizontal Motion Ball 125 U0025 00 VDELP0 ds 1 ; $25 0000 000x Vertical Delay Player 0 126 U0026 00 VDELP1 ds 1 ; $26 0000 000x Vertical Delay Player 1 127 U0027 00 VDELBL ds 1 ; $27 0000 000x Vertical Delay Ball 128 U0028 00 RESMP0 ds 1 ; $28 0000 00x0 Reset Missle 0 to Player 0 129 U0029 00 RESMP1 ds 1 ; $29 0000 00x0 Reset Missle 1 to Player 1 130 U002a 00 HMOVE ds 1 ; $2A ---- ---- Apply Horizontal Motion 131 U002b 00 HMCLR ds 1 ; $2B ---- ---- Clear Horizontal Move Registers 132 U002c 00 CXCLR ds 1 ; $2C ---- ---- Clear Collision Latches 133 U002d 134 U002d ;------------------------------------------------------------------------------- 135 U002d 136 U000e SEG.U TIA_REGISTERS_READ 137 U0000 ORG TIA_BASE_READ_ADDRESS 138 U0000 139 U0000 ; bit 7 bit 6 140 U0000 00 CXM0P ds 1 ; $00 xx00 0000 Read Collision M0-P1 M0-P0 141 U0001 00 CXM1P ds 1 ; $01 xx00 0000 M1-P0 M1-P1 142 U0002 00 CXP0FB ds 1 ; $02 xx00 0000 P0-PF P0-BL 143 U0003 00 CXP1FB ds 1 ; $03 xx00 0000 P1-PF P1-BL 144 U0004 00 CXM0FB ds 1 ; $04 xx00 0000 M0-PF M0-BL 145 U0005 00 CXM1FB ds 1 ; $05 xx00 0000 M1-PF M1-BL 146 U0006 00 CXBLPF ds 1 ; $06 x000 0000 BL-PF ----- 147 U0007 00 CXPPMM ds 1 ; $07 xx00 0000 P0-P1 M0-M1 148 U0008 00 INPT0 ds 1 ; $08 x000 0000 Read Pot Port 0 149 U0009 00 INPT1 ds 1 ; $09 x000 0000 Read Pot Port 1 150 U000a 00 INPT2 ds 1 ; $0A x000 0000 Read Pot Port 2 151 U000b 00 INPT3 ds 1 ; $0B x000 0000 Read Pot Port 3 152 U000c 00 INPT4 ds 1 ; $0C x000 0000 Read Input (Trigger) 0 153 U000d 00 INPT5 ds 1 ; $0D x000 0000 Read Input (Trigger) 1 154 U000e 155 U000e ;------------------------------------------------------------------------------- 156 U000e 157 U0298 SEG.U RIOT 158 U0280 ORG $280 159 U0280 160 U0280 ; RIOT MEMORY MAP 161 U0280 162 U0280 00 SWCHA ds 1 ; $280 Port A data register for joysticks: 163 U0281 ; Bits 4-7 for player 1. Bits 0-3 for player 2. 164 U0281 165 U0281 00 SWACNT ds 1 ; $281 Port A data direction register (DDR) 166 U0282 00 SWCHB ds 1 ; $282 Port B data (console switches) 167 U0283 00 SWBCNT ds 1 ; $283 Port B DDR 168 U0284 00 INTIM ds 1 ; $284 Timer output 169 U0285 170 U0285 00 TIMINT ds 1 ; $285 171 U0286 172 U0286 ; Unused/undefined registers ($285-$294) 173 U0286 174 U0286 00 ds 1 ; $286 175 U0287 00 ds 1 ; $287 176 U0288 00 ds 1 ; $288 177 U0289 00 ds 1 ; $289 178 U028a 00 ds 1 ; $28A 179 U028b 00 ds 1 ; $28B 180 U028c 00 ds 1 ; $28C 181 U028d 00 ds 1 ; $28D 182 U028e 00 ds 1 ; $28E 183 U028f 00 ds 1 ; $28F 184 U0290 00 ds 1 ; $290 185 U0291 00 ds 1 ; $291 186 U0292 00 ds 1 ; $292 187 U0293 00 ds 1 ; $293 188 U0294 189 U0294 00 TIM1T ds 1 ; $294 set 1 clock interval 190 U0295 00 TIM8T ds 1 ; $295 set 8 clock interval 191 U0296 00 TIM64T ds 1 ; $296 set 64 clock interval 192 U0297 00 T1024T ds 1 ; $297 set 1024 clock interval 193 U0298 194 U0298 ;------------------------------------------------------------------------------- 195 U0298 ; The following required for back-compatibility with code which does not use 196 U0298 ; segments. 197 U0298 198 3000 ???? SEG 199 3000 ???? 200 3000 ???? ; EOF ------- FILE 2600basic.h ------- FILE macro.h LEVEL 3 PASS 2 0 3000 ???? include "macro.h" 1 3000 ???? ; MACRO.H 2 3000 ???? ; Version 1.05, 13/NOVEMBER/2003 3 3000 ???? 4 3000 ???? 00 69 VERSION_MACRO = 105 5 3000 ???? 6 3000 ???? ; 7 3000 ???? ; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE 8 3000 ???? ; PLEASE DO *NOT* REDISTRIBUTE MODIFIED VERSIONS OF THIS FILE! 9 3000 ???? ; 10 3000 ???? ; This file defines DASM macros useful for development for the Atari 2600. 11 3000 ???? ; It is distributed as a companion machine-specific support package 12 3000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 13 3000 ???? ; available at at http://www.atari2600.org/dasm 14 3000 ???? ; 15 3000 ???? ; Many thanks to the people who have contributed. If you take issue with the 16 3000 ???? ; contents, or would like to add something, please write to me 17 3000 ???? ; (atari2600@taswegian.com) with your contribution. 18 3000 ???? ; 19 3000 ???? ; Latest Revisions... 20 3000 ???? ; 21 3000 ???? ; 1.05 14/NOV/2003 - Added VERSION_MACRO equate (which will reflect 100x version #) 22 3000 ???? ; This will allow conditional code to verify MACRO.H being 23 3000 ???? ; used for code assembly. 24 3000 ???? ; 1.04 13/NOV/2003 - SET_POINTER macro added (16-bit address load) 25 3000 ???? ; 26 3000 ???? ; 1.03 23/JUN/2003 - CLEAN_START macro added - clears TIA, RAM, registers 27 3000 ???? ; 28 3000 ???? ; 1.02 14/JUN/2003 - VERTICAL_SYNC macro added 29 3000 ???? ; (standardised macro for vertical synch code) 30 3000 ???? ; 1.01 22/MAR/2003 - SLEEP macro added. 31 3000 ???? ; - NO_ILLEGAL_OPCODES switch implemented 32 3000 ???? ; 1.0 22/MAR/2003 Initial release 33 3000 ???? 34 3000 ???? ; Note: These macros use illegal opcodes. To disable illegal opcode usage, 35 3000 ???? ; define the symbol NO_ILLEGAL_OPCODES (-DNO_ILLEGAL_OPCODES=1 on command-line). 36 3000 ???? ; If you do not allow illegal opcode usage, you must include this file 37 3000 ???? ; *after* including VCS.H (as the non-illegal opcodes access hardware 38 3000 ???? ; registers and require them to be defined first). 39 3000 ???? 40 3000 ???? ; Available macros... 41 3000 ???? ; SLEEP n - sleep for n cycles 42 3000 ???? ; VERTICAL_SYNC - correct 3 scanline vertical synch code 43 3000 ???? ; CLEAN_START - set machine to known state on startup 44 3000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable 45 3000 ???? 46 3000 ???? ;------------------------------------------------------------------------------- 47 3000 ???? ; SLEEP duration 48 3000 ???? ; Original author: Thomas Jentzsch 49 3000 ???? ; Inserts code which takes the specified number of cycles to execute. This is 50 3000 ???? ; useful for code where precise timing is required. 51 3000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS. 52 3000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS 53 3000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards). 54 3000 ???? 55 3000 ???? MAC sleep 56 3000 ???? .CYCLES SET {1} 57 3000 ???? 58 3000 ???? IF .CYCLES < 2 59 3000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 60 3000 ???? ERR 61 3000 ???? ENDIF 62 3000 ???? 63 3000 ???? IF .CYCLES & 1 64 3000 ???? IFNCONST NO_ILLEGAL_OPCODES 65 3000 ???? nop 0 66 3000 ???? ELSE 67 3000 ???? bit VSYNC 68 3000 ???? ENDIF 69 3000 ???? .CYCLES SET .CYCLES - 3 70 3000 ???? ENDIF 71 3000 ???? 72 3000 ???? REPEAT .CYCLES / 2 73 3000 ???? nop 74 3000 ???? REPEND 75 3000 ???? ENDM ;usage: SLEEP n (n>1) 76 3000 ???? 77 3000 ???? ;------------------------------------------------------------------------------- 78 3000 ???? ; VERTICAL_SYNC 79 3000 ???? ; Original author: Manuel Polik 80 3000 ???? ; Inserts the code required for a proper 3 scannline 81 3000 ???? ; vertical sync sequence 82 3000 ???? ; 83 3000 ???? ; Note: Alters the accumulator 84 3000 ???? ; 85 3000 ???? ; IN: 86 3000 ???? ; OUT: A = 1 87 3000 ???? 88 3000 ???? MAC vertical_sync 89 3000 ???? LDA #$02 ; A = VSYNC enable 90 3000 ???? STA WSYNC ; Finish current line 91 3000 ???? STA VSYNC ; Start vertical sync 92 3000 ???? STA WSYNC ; 1st line vertical sync 93 3000 ???? STA WSYNC ; 2nd line vertical sync 94 3000 ???? LSR ; A = VSYNC disable 95 3000 ???? STA WSYNC ; 3rd line vertical sync 96 3000 ???? STA VSYNC ; Stop vertical sync 97 3000 ???? ENDM 98 3000 ???? 99 3000 ???? ;------------------------------------------------------------------------------- 100 3000 ???? ; CLEAN_START 101 3000 ???? ; Original author: Andrew Davie 102 3000 ???? ; Standardised start-up code, clears stack, all TIA registers and RAM to 0 103 3000 ???? ; Sets stack pointer to $FF, and all registers to 0 104 3000 ???? ; Sets decimal mode off, sets interrupt flag (kind of un-necessary) 105 3000 ???? ; Use as very first section of code on boot (ie: at reset) 106 3000 ???? ; Code written to minimise total ROM usage - uses weird 6502 knowledge :) 107 3000 ???? 108 3000 ???? MAC clean_start 109 3000 ???? sei 110 3000 ???? cld 111 3000 ???? 112 3000 ???? ldx #0 113 3000 ???? txa 114 3000 ???? tay 115 3000 ???? .CLEAR_STACK dex 116 3000 ???? txs 117 3000 ???? pha 118 3000 ???? bne .CLEAR_STACK ; SP=$FF, X = A = Y = 0 119 3000 ???? 120 3000 ???? ENDM 121 3000 ???? 122 3000 ???? ;------------------------------------------------------- 123 3000 ???? ; SET_POINTER 124 3000 ???? ; Original author: Manuel Rotschkar 125 3000 ???? ; 126 3000 ???? ; Sets a 2 byte RAM pointer to an absolute address. 127 3000 ???? ; 128 3000 ???? ; Usage: SET_POINTER pointer, address 129 3000 ???? ; Example: SET_POINTER SpritePTR, SpriteData 130 3000 ???? ; 131 3000 ???? ; Note: Alters the accumulator, NZ flags 132 3000 ???? ; IN 1: 2 byte RAM location reserved for pointer 133 3000 ???? ; IN 2: absolute address 134 3000 ???? 135 3000 ???? MAC set_pointer 136 3000 ???? .POINTER SET {1} 137 3000 ???? .ADDRESS SET {2} 138 3000 ???? 139 3000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address 140 3000 ???? STA .POINTER ; Store in pointer 141 3000 ???? LDA #>.ADDRESS ; Get Hibyte of Address 142 3000 ???? STA .POINTER+1 ; Store in pointer+1 143 3000 ???? 144 3000 ???? ENDM 145 3000 ???? 146 3000 ???? ; EOF ------- FILE 2600basic.h ------- FILE 2600basic_variable_redefs.h LEVEL 3 PASS 2 0 3000 ???? include "2600basic_variable_redefs.h" 1 3000 ???? ; This file contains variable mapping and other information for the current project. 2 3000 ???? 3 3000 ???? 00 20 bscode_length = 32 4 3000 ???? 00 e2 dead_counter = m 5 3000 ???? 6 3000 ???? 00 e1 crash_counter = l 7 3000 ???? 8 3000 ???? 00 e0 bassvol = k 9 3000 ???? 10 3000 ???? 00 df bassfreq = j 11 3000 ???? 12 3000 ???? 00 de mdelaycounter = i 13 3000 ???? 14 3000 ???? 00 dd mindex = h 15 3000 ???? 16 3000 ???? 00 dc gameFrames = g 17 3000 ???? 18 3000 ???? 00 db playfield_design = f 19 3000 ???? 20 3000 ???? 00 da player1_frame = e 21 3000 ???? 22 3000 ???? 00 d9 player1_design = d 23 3000 ???? 24 3000 ???? 00 d8 player0_frame = c 25 3000 ???? 26 3000 ???? 00 d7 player0_design = b 27 3000 ???? 28 3000 ???? 00 d6 level_value = a 29 3000 ???? 30 3000 ???? 00 90 _Music1_length = .skipL012-_Music1 31 3000 ???? 32 3000 ???? 00 5c _Music0_length = .skipL011-_Music0 33 3000 ???? 34 3000 ???? 00 01 Metroid_EnergyTank = 1 35 3000 ???? 36 3000 ???? 00 00 Flag = 0 37 3000 ???? 38 3000 ???? 00 01 pfscore = 1 39 3000 ???? 40 3000 ???? 00 2b vblank_time = 43 41 3000 ???? 00 25 overscan_time = 37 42 3000 ???? 00 01 superchip = 1 43 3000 ???? 00 01 bs_mask = 1 44 3000 ???? 00 08 bankswitch = 8 45 3000 ???? 1f f8 bankswitch_hotspot = $1FF8 46 3000 ???? 00 01 no_blank_lines = 1 47 3000 ???? 00 01 player1colors = 1 ------- FILE 2600basic.h 5 3000 ???? 6 3000 ???? 00 80 player0x = $80 7 3000 ???? 00 81 player1x = $81 8 3000 ???? 00 82 missile0x = $82 9 3000 ???? 00 83 missile1x = $83 10 3000 ???? 00 84 ballx = $84 11 3000 ???? 12 3000 ???? 00 85 objecty = $85 13 3000 ???? 00 85 player0y = $85 14 3000 ???? 00 86 player1y = $86 15 3000 ???? 00 87 missile1height = $87 16 3000 ???? 00 88 missile1y = $88 17 3000 ???? 00 89 bally = $89 18 3000 ???? 19 3000 ???? 00 87 player1color = $87 ; replaces missile 1 20 3000 ???? 21 3000 ???? 00 8a player0pointer = $8A ;uses $8A-$8B 22 3000 ???? 00 8a player0pointerlo = $8A 23 3000 ???? 00 8b player0pointerhi = $8B 24 3000 ???? 00 8c player1pointer = $8C ; $8C-$8D 25 3000 ???? 00 8c player1pointerlo = $8C 26 3000 ???? 00 8d player1pointerhi = $8D 27 3000 ???? 28 3000 ???? 00 8e player0height = $8E 29 3000 ???? 00 8f player1height = $8F 30 3000 ???? 00 90 missile0height = $90 31 3000 ???? 00 91 missile0y = $91 32 3000 ???? 00 92 ballheight = $92 33 3000 ???? 34 3000 ???? 00 90 currentpaddle = $90 ; replaces missile 0 (and can't be used with playercolor) 35 3000 ???? 00 91 paddle = $91 ; replaces missile 0 36 3000 ???? 00 82 player0colorstore = $82 ; replaces missile 0 37 3000 ???? 00 90 player0color = $90 ; replaces missile 0 38 3000 ???? 39 3000 ???? 00 93 score = $93 ; $93-$95 40 3000 ???? 00 96 scorepointers = $96 ; $96-$9B = 6 bytes 41 3000 ???? 00 9c temp1 = $9C ;used by kernel. can be used in program too, but 42 3000 ???? 00 9d temp2 = $9D ;are obliterated when drawscreen is called. 43 3000 ???? 00 9e temp3 = $9E 44 3000 ???? 00 9f temp4 = $9F 45 3000 ???? 00 a0 temp5 = $A0 46 3000 ???? 00 a1 temp6 = $A1 47 3000 ???? 48 3000 ???? 00 a2 rand = $A2 49 3000 ???? 00 a3 scorecolor = $A3 50 3000 ???? 51 3000 ???? 00 a4 var0 = $A4 52 3000 ???? 00 a5 var1 = $A5 53 3000 ???? 00 a6 var2 = $A6 54 3000 ???? 00 a7 var3 = $A7 55 3000 ???? 00 a8 var4 = $A8 56 3000 ???? 00 a9 var5 = $A9 57 3000 ???? 00 aa var6 = $AA 58 3000 ???? 00 ab var7 = $AB 59 3000 ???? 00 ac var8 = $AC 60 3000 ???? 00 ad var9 = $AD 61 3000 ???? 00 ae var10 = $AE 62 3000 ???? 00 af var11 = $AF 63 3000 ???? 00 b0 var12 = $B0 64 3000 ???? 00 b1 var13 = $B1 65 3000 ???? 00 b2 var14 = $B2 66 3000 ???? 00 b3 var15 = $B3 67 3000 ???? 00 b4 var16 = $B4 68 3000 ???? 00 b5 var17 = $B5 69 3000 ???? 00 b6 var18 = $B6 70 3000 ???? 00 b7 var19 = $B7 71 3000 ???? 00 b8 var20 = $B8 72 3000 ???? 00 b9 var21 = $B9 73 3000 ???? 00 ba var22 = $BA 74 3000 ???? 00 bb var23 = $BB 75 3000 ???? 00 bc var24 = $BC 76 3000 ???? 00 bd var25 = $BD 77 3000 ???? 00 be var26 = $BE 78 3000 ???? 00 bf var27 = $BF 79 3000 ???? 00 c0 var28 = $C0 80 3000 ???? 00 c1 var29 = $C1 81 3000 ???? 00 c2 var30 = $C2 82 3000 ???? 00 c3 var31 = $C3 83 3000 ???? 00 c4 var32 = $C4 84 3000 ???? 00 c5 var33 = $C5 85 3000 ???? 00 c6 var34 = $C6 86 3000 ???? 00 c7 var35 = $C7 87 3000 ???? 00 c8 var36 = $C8 88 3000 ???? 00 c9 var37 = $C9 89 3000 ???? 00 ca var38 = $CA 90 3000 ???? 00 cb var39 = $CB 91 3000 ???? 00 cc var40 = $CC 92 3000 ???? 00 cd var41 = $CD 93 3000 ???? 00 ce var42 = $CE 94 3000 ???? 00 cf var43 = $CF 95 3000 ???? 00 d0 var44 = $D0 96 3000 ???? 00 d1 var45 = $D1 97 3000 ???? 00 d2 var46 = $D2 98 3000 ???? 00 d3 var47 = $D3 99 3000 ???? 100 3000 ???? 00 d4 temp7 = $D4 ; This is used to aid in bankswitching 101 3000 ???? 102 3000 ???? 00 d5 playfieldpos = $D5 103 3000 ???? 104 3000 ???? 00 d6 A = $d6 105 3000 ???? 00 d6 a = $d6 106 3000 ???? 00 d7 B = $d7 107 3000 ???? 00 d7 b = $d7 108 3000 ???? 00 d8 C = $d8 109 3000 ???? 00 d8 c = $d8 110 3000 ???? 00 d9 D = $d9 111 3000 ???? 00 d9 d = $d9 112 3000 ???? 00 da E = $da 113 3000 ???? 00 da e = $da 114 3000 ???? 00 db F = $db 115 3000 ???? 00 db f = $db 116 3000 ???? 00 dc G = $dc 117 3000 ???? 00 dc g = $dc 118 3000 ???? 00 dd H = $dd 119 3000 ???? 00 dd h = $dd 120 3000 ???? 00 de I = $de 121 3000 ???? 00 de i = $de 122 3000 ???? 00 df J = $df 123 3000 ???? 00 df j = $df 124 3000 ???? 00 e0 K = $e0 125 3000 ???? 00 e0 k = $e0 126 3000 ???? 00 e1 L = $e1 127 3000 ???? 00 e1 l = $e1 128 3000 ???? 00 e2 M = $e2 129 3000 ???? 00 e2 m = $e2 130 3000 ???? 00 e3 N = $e3 131 3000 ???? 00 e3 n = $e3 132 3000 ???? 00 e4 O = $e4 133 3000 ???? 00 e4 o = $e4 134 3000 ???? 00 e5 P = $e5 135 3000 ???? 00 e5 p = $e5 136 3000 ???? 00 e6 Q = $e6 137 3000 ???? 00 e6 q = $e6 138 3000 ???? 00 e7 R = $e7 139 3000 ???? 00 e7 r = $e7 140 3000 ???? 00 e8 S = $e8 141 3000 ???? 00 e8 s = $e8 142 3000 ???? 00 e9 T = $e9 143 3000 ???? 00 e9 t = $e9 144 3000 ???? 00 ea U = $ea 145 3000 ???? 00 ea u = $ea 146 3000 ???? 00 eb V = $eb 147 3000 ???? 00 eb v = $eb 148 3000 ???? 00 ec W = $ec 149 3000 ???? 00 ec w = $ec 150 3000 ???? 00 ed X = $ed 151 3000 ???? 00 ed x = $ed 152 3000 ???? 00 ee Y = $ee 153 3000 ???? 00 ee y = $ee 154 3000 ???? 00 ef Z = $ef 155 3000 ???? 00 ef z = $ef 156 3000 ???? 157 3000 ???? ; available for other uses, or if unused, provide more stack space 158 3000 ???? 159 3000 ???? 00 f0 aux1 = $f0 160 3000 ???? 00 f1 aux2 = $f1 161 3000 ???? 00 f2 aux3 = $f2 162 3000 ???? 00 f3 aux4 = $f3 163 3000 ???? 00 f4 aux5 = $f4 164 3000 ???? 00 f5 aux6 = $f5 165 3000 ???? 166 3000 ???? ; playfield color/height pointers 167 3000 ???? 00 f0 pfcolortable = $f0 ; and $d5 168 3000 ???? 00 f0 pfheighttable = $f0 ; and $d5 169 3000 ???? ; the above pointers are the same because if color and height are both used together, 170 3000 ???? ; they must used absolute indexed and cannot use pointers 171 3000 ???? 172 3000 ???? 00 f2 lifepointer = $f2 ; pointer to "lives" shape 173 3000 ???? ; upper 3 bits of $f2 contain the number of lives 174 3000 ???? 00 f4 lifecolor = $f4 175 3000 ???? 00 f3 lives = $f3 ; # lives >> 5 176 3000 ???? 00 f5 statusbarlength = $f5 ; only uses upper 5 bits; other bits free 177 3000 ???? 178 3000 ???? 00 f2 pfscore1 = $f2 ; optional playfield bytes in score 179 3000 ???? 00 f3 pfscore2 = $f3 180 3000 ???? 00 f4 pfscorecolor = $f4 181 3000 ???? 182 3000 ???? 00 f6 stack1 = $f6 183 3000 ???? 00 f7 stack2 = $f7 184 3000 ???? 00 f8 stack3 = $f8 185 3000 ???? 00 f9 stack4 = $f9 186 3000 ???? ; the stack bytes above may be used in the kernel 187 3000 ???? ; stack = F6-F7, F8-F9, FA-FB, FC-FD, FE-FF 188 3000 ???? 189 3000 ???? MAC return 190 3000 ???? ifnconst bankswitch 191 3000 ???? rts 192 3000 ???? else 193 3000 ???? jmp BS_return 194 3000 ???? endif 195 3000 ???? ENDM ; auto-return from either a regular or bankswitched module 196 3000 ???? 197 3000 ???? ifconst superchip 198 3000 ???? 10 d0 playfieldbase = $10D0 ------- FILE superchip.h LEVEL 3 PASS 2 0 3000 ???? include superchip.h 1 3000 ???? f0 00 write_RAM = $F000 2 3000 ???? f0 00 wRAM = $F000 3 3000 ???? f0 00 w000 = $F000 4 3000 ???? f0 01 w001 = $F001 5 3000 ???? f0 02 w002 = $F002 6 3000 ???? f0 03 w003 = $F003 7 3000 ???? f0 04 w004 = $F004 8 3000 ???? f0 05 w005 = $F005 9 3000 ???? f0 06 w006 = $F006 10 3000 ???? f0 07 w007 = $F007 11 3000 ???? f0 08 w008 = $F008 12 3000 ???? f0 09 w009 = $F009 13 3000 ???? f0 0a w010 = $F00A 14 3000 ???? f0 0b w011 = $F00B 15 3000 ???? f0 0c w012 = $F00C 16 3000 ???? f0 0d w013 = $F00D 17 3000 ???? f0 0e w014 = $F00E 18 3000 ???? f0 0f w015 = $F00F 19 3000 ???? f0 10 w016 = $F010 20 3000 ???? f0 11 w017 = $F011 21 3000 ???? f0 12 w018 = $F012 22 3000 ???? f0 13 w019 = $F013 23 3000 ???? f0 14 w020 = $F014 24 3000 ???? f0 15 w021 = $F015 25 3000 ???? f0 16 w022 = $F016 26 3000 ???? f0 17 w023 = $F017 27 3000 ???? f0 18 w024 = $F018 28 3000 ???? f0 19 w025 = $F019 29 3000 ???? f0 1a w026 = $F01A 30 3000 ???? f0 1b w027 = $F01B 31 3000 ???? f0 1c w028 = $F01C 32 3000 ???? f0 1d w029 = $F01D 33 3000 ???? f0 1e w030 = $F01E 34 3000 ???? f0 1f w031 = $F01F 35 3000 ???? f0 20 w032 = $F020 36 3000 ???? f0 21 w033 = $F021 37 3000 ???? f0 22 w034 = $F022 38 3000 ???? f0 23 w035 = $F023 39 3000 ???? f0 24 w036 = $F024 40 3000 ???? f0 25 w037 = $F025 41 3000 ???? f0 26 w038 = $F026 42 3000 ???? f0 27 w039 = $F027 43 3000 ???? f0 28 w040 = $F028 44 3000 ???? f0 29 w041 = $F029 45 3000 ???? f0 2a w042 = $F02A 46 3000 ???? f0 2b w043 = $F02B 47 3000 ???? f0 2c w044 = $F02C 48 3000 ???? f0 2d w045 = $F02D 49 3000 ???? f0 2e w046 = $F02E 50 3000 ???? f0 2f w047 = $F02F 51 3000 ???? f0 30 w048 = $F030 52 3000 ???? f0 31 w049 = $F031 53 3000 ???? f0 32 w050 = $F032 54 3000 ???? f0 33 w051 = $F033 55 3000 ???? f0 34 w052 = $F034 56 3000 ???? f0 35 w053 = $F035 57 3000 ???? f0 36 w054 = $F036 58 3000 ???? f0 37 w055 = $F037 59 3000 ???? f0 38 w056 = $F038 60 3000 ???? f0 39 w057 = $F039 61 3000 ???? f0 3a w058 = $F03A 62 3000 ???? f0 3b w059 = $F03B 63 3000 ???? f0 3c w060 = $F03C 64 3000 ???? f0 3d w061 = $F03D 65 3000 ???? f0 3e w062 = $F03E 66 3000 ???? f0 3f w063 = $F03F 67 3000 ???? f0 40 w064 = $F040 68 3000 ???? f0 41 w065 = $F041 69 3000 ???? f0 42 w066 = $F042 70 3000 ???? f0 43 w067 = $F043 71 3000 ???? f0 44 w068 = $F044 72 3000 ???? f0 45 w069 = $F045 73 3000 ???? f0 46 w070 = $F046 74 3000 ???? f0 47 w071 = $F047 75 3000 ???? f0 48 w072 = $F048 76 3000 ???? f0 49 w073 = $F049 77 3000 ???? f0 4a w074 = $F04A 78 3000 ???? f0 4b w075 = $F04B 79 3000 ???? f0 4c w076 = $F04C 80 3000 ???? f0 4d w077 = $F04D 81 3000 ???? f0 4e w078 = $F04E 82 3000 ???? f0 4f w079 = $F04F 83 3000 ???? f0 50 w080 = $F050 84 3000 ???? f0 51 w081 = $F051 85 3000 ???? f0 52 w082 = $F052 86 3000 ???? f0 53 w083 = $F053 87 3000 ???? f0 54 w084 = $F054 88 3000 ???? f0 55 w085 = $F055 89 3000 ???? f0 56 w086 = $F056 90 3000 ???? f0 57 w087 = $F057 91 3000 ???? f0 58 w088 = $F058 92 3000 ???? f0 59 w089 = $F059 93 3000 ???? f0 5a w090 = $F05A 94 3000 ???? f0 5b w091 = $F05B 95 3000 ???? f0 5c w092 = $F05C 96 3000 ???? f0 5d w093 = $F05D 97 3000 ???? f0 5e w094 = $F05E 98 3000 ???? f0 5f w095 = $F05F 99 3000 ???? f0 60 w096 = $F060 100 3000 ???? f0 61 w097 = $F061 101 3000 ???? f0 62 w098 = $F062 102 3000 ???? f0 63 w099 = $F063 103 3000 ???? f0 64 w100 = $F064 104 3000 ???? f0 65 w101 = $F065 105 3000 ???? f0 66 w102 = $F066 106 3000 ???? f0 67 w103 = $F067 107 3000 ???? f0 68 w104 = $F068 108 3000 ???? f0 69 w105 = $F069 109 3000 ???? f0 6a w106 = $F06A 110 3000 ???? f0 6b w107 = $F06B 111 3000 ???? f0 6c w108 = $F06C 112 3000 ???? f0 6d w109 = $F06D 113 3000 ???? f0 6e w110 = $F06E 114 3000 ???? f0 6f w111 = $F06F 115 3000 ???? f0 70 w112 = $F070 116 3000 ???? f0 71 w113 = $F071 117 3000 ???? f0 72 w114 = $F072 118 3000 ???? f0 73 w115 = $F073 119 3000 ???? f0 74 w116 = $F074 120 3000 ???? f0 75 w117 = $F075 121 3000 ???? f0 76 w118 = $F076 122 3000 ???? f0 77 w119 = $F077 123 3000 ???? f0 78 w120 = $F078 124 3000 ???? f0 79 w121 = $F079 125 3000 ???? f0 7a w122 = $F07A 126 3000 ???? f0 7b w123 = $F07B 127 3000 ???? f0 7c w124 = $F07C 128 3000 ???? f0 7d w125 = $F07D 129 3000 ???? f0 7e w126 = $F07E 130 3000 ???? f0 7f w127 = $F07F 131 3000 ???? 132 3000 ???? f0 80 read_RAM = $F080 133 3000 ???? f0 80 rRAM = $F080 134 3000 ???? f0 80 r000 = $F080 135 3000 ???? f0 81 r001 = $F081 136 3000 ???? f0 82 r002 = $F082 137 3000 ???? f0 83 r003 = $F083 138 3000 ???? f0 84 r004 = $F084 139 3000 ???? f0 85 r005 = $F085 140 3000 ???? f0 86 r006 = $F086 141 3000 ???? f0 87 r007 = $F087 142 3000 ???? f0 88 r008 = $F088 143 3000 ???? f0 89 r009 = $F089 144 3000 ???? f0 8a r010 = $F08A 145 3000 ???? f0 8b r011 = $F08B 146 3000 ???? f0 8c r012 = $F08C 147 3000 ???? f0 8d r013 = $F08D 148 3000 ???? f0 8e r014 = $F08E 149 3000 ???? f0 8f r015 = $F08F 150 3000 ???? f0 90 r016 = $F090 151 3000 ???? f0 91 r017 = $F091 152 3000 ???? f0 92 r018 = $F092 153 3000 ???? f0 93 r019 = $F093 154 3000 ???? f0 94 r020 = $F094 155 3000 ???? f0 95 r021 = $F095 156 3000 ???? f0 96 r022 = $F096 157 3000 ???? f0 97 r023 = $F097 158 3000 ???? f0 98 r024 = $F098 159 3000 ???? f0 99 r025 = $F099 160 3000 ???? f0 9a r026 = $F09A 161 3000 ???? f0 9b r027 = $F09B 162 3000 ???? f0 9c r028 = $F09C 163 3000 ???? f0 9d r029 = $F09D 164 3000 ???? f0 9e r030 = $F09E 165 3000 ???? f0 9f r031 = $F09F 166 3000 ???? f0 a0 r032 = $F0A0 167 3000 ???? f0 a1 r033 = $F0A1 168 3000 ???? f0 a2 r034 = $F0A2 169 3000 ???? f0 a3 r035 = $F0A3 170 3000 ???? f0 a4 r036 = $F0A4 171 3000 ???? f0 a5 r037 = $F0A5 172 3000 ???? f0 a6 r038 = $F0A6 173 3000 ???? f0 a7 r039 = $F0A7 174 3000 ???? f0 a8 r040 = $F0A8 175 3000 ???? f0 a9 r041 = $F0A9 176 3000 ???? f0 aa r042 = $F0AA 177 3000 ???? f0 ab r043 = $F0AB 178 3000 ???? f0 ac r044 = $F0AC 179 3000 ???? f0 ad r045 = $F0AD 180 3000 ???? f0 ae r046 = $F0AE 181 3000 ???? f0 af r047 = $F0AF 182 3000 ???? f0 b0 r048 = $F0B0 183 3000 ???? f0 b1 r049 = $F0B1 184 3000 ???? f0 b2 r050 = $F0B2 185 3000 ???? f0 b3 r051 = $F0B3 186 3000 ???? f0 b4 r052 = $F0B4 187 3000 ???? f0 b5 r053 = $F0B5 188 3000 ???? f0 b6 r054 = $F0B6 189 3000 ???? f0 b7 r055 = $F0B7 190 3000 ???? f0 b8 r056 = $F0B8 191 3000 ???? f0 b9 r057 = $F0B9 192 3000 ???? f0 ba r058 = $F0BA 193 3000 ???? f0 bb r059 = $F0BB 194 3000 ???? f0 bc r060 = $F0BC 195 3000 ???? f0 bd r061 = $F0BD 196 3000 ???? f0 be r062 = $F0BE 197 3000 ???? f0 bf r063 = $F0BF 198 3000 ???? f0 c0 r064 = $F0C0 199 3000 ???? f0 c1 r065 = $F0C1 200 3000 ???? f0 c2 r066 = $F0C2 201 3000 ???? f0 c3 r067 = $F0C3 202 3000 ???? f0 c4 r068 = $F0C4 203 3000 ???? f0 c5 r069 = $F0C5 204 3000 ???? f0 c6 r070 = $F0C6 205 3000 ???? f0 c7 r071 = $F0C7 206 3000 ???? f0 c8 r072 = $F0C8 207 3000 ???? f0 c9 r073 = $F0C9 208 3000 ???? f0 ca r074 = $F0CA 209 3000 ???? f0 cb r075 = $F0CB 210 3000 ???? f0 cc r076 = $F0CC 211 3000 ???? f0 cd r077 = $F0CD 212 3000 ???? f0 ce r078 = $F0CE 213 3000 ???? f0 cf r079 = $F0CF 214 3000 ???? f0 d0 r080 = $F0D0 215 3000 ???? f0 d1 r081 = $F0D1 216 3000 ???? f0 d2 r082 = $F0D2 217 3000 ???? f0 d3 r083 = $F0D3 218 3000 ???? f0 d4 r084 = $F0D4 219 3000 ???? f0 d5 r085 = $F0D5 220 3000 ???? f0 d6 r086 = $F0D6 221 3000 ???? f0 d7 r087 = $F0D7 222 3000 ???? f0 d8 r088 = $F0D8 223 3000 ???? f0 d9 r089 = $F0D9 224 3000 ???? f0 da r090 = $F0DA 225 3000 ???? f0 db r091 = $F0DB 226 3000 ???? f0 dc r092 = $F0DC 227 3000 ???? f0 dd r093 = $F0DD 228 3000 ???? f0 de r094 = $F0DE 229 3000 ???? f0 df r095 = $F0DF 230 3000 ???? f0 e0 r096 = $F0E0 231 3000 ???? f0 e1 r097 = $F0E1 232 3000 ???? f0 e2 r098 = $F0E2 233 3000 ???? f0 e3 r099 = $F0E3 234 3000 ???? f0 e4 r100 = $F0E4 235 3000 ???? f0 e5 r101 = $F0E5 236 3000 ???? f0 e6 r102 = $F0E6 237 3000 ???? f0 e7 r103 = $F0E7 238 3000 ???? f0 e8 r104 = $F0E8 239 3000 ???? f0 e9 r105 = $F0E9 240 3000 ???? f0 ea r106 = $F0EA 241 3000 ???? f0 eb r107 = $F0EB 242 3000 ???? f0 ec r108 = $F0EC 243 3000 ???? f0 ed r109 = $F0ED 244 3000 ???? f0 ee r110 = $F0EE 245 3000 ???? f0 ef r111 = $F0EF 246 3000 ???? f0 f0 r112 = $F0F0 247 3000 ???? f0 f1 r113 = $F0F1 248 3000 ???? f0 f2 r114 = $F0F2 249 3000 ???? f0 f3 r115 = $F0F3 250 3000 ???? f0 f4 r116 = $F0F4 251 3000 ???? f0 f5 r117 = $F0F5 252 3000 ???? f0 f6 r118 = $F0F6 253 3000 ???? f0 f7 r119 = $F0F7 254 3000 ???? f0 f8 r120 = $F0F8 255 3000 ???? f0 f9 r121 = $F0F9 256 3000 ???? f0 fa r122 = $F0FA 257 3000 ???? f0 fb r123 = $F0FB 258 3000 ???? f0 fc r124 = $F0FC 259 3000 ???? f0 fd r125 = $F0FD 260 3000 ???? f0 fe r126 = $F0FE 261 3000 ???? f0 ff r127 = $F0FF ------- FILE 2600basic.h 200 3000 ???? - else 201 3000 ???? -playfieldbase = $A4 202 3000 ???? endif 203 3000 ???? 204 3000 ???? ifnconst pfhalfwidth 205 3000 ???? 00 04 pfwidth = 4 206 3000 ???? 00 0e PF1L = PF1 207 3000 ???? 00 0f PF2L = PF2 208 3000 ???? 00 0e PF1R = PF1 209 3000 ???? 00 0f PF2R = PF2 210 3000 ???? 00 00 pfadjust = 0 211 3000 ???? - else 212 3000 ???? -pfwidth = 2 213 3000 ???? - ifconst pfcenter 214 3000 ???? -PF1L = $3F ; no effect 215 3000 ???? -PF2L = PF2 216 3000 ???? -PF1R = $3F 217 3000 ???? -PF2R = PF2 ; no effect 218 3000 ???? -pfadjust = 1 219 3000 ???? - else 220 3000 ???? -PF1L = PF1 221 3000 ???? -PF2L = PF2 222 3000 ???? -PF1R = $3F ; no effect 223 3000 ???? -PF2R = $3F ; no effect 224 3000 ???? -pfadjust = 0 225 3000 ???? - endif 226 3000 ???? endif 227 3000 ???? 228 3000 ???? ; define playfield start based on height 229 3000 ???? ifnconst pfres 230 3000 ???? 10 d0 playfield = playfieldbase 231 3000 ???? - else 232 3000 ???? -playfield = playfieldbase-(pfres-12*(4/pfwidth))*pfwidth 233 3000 ???? endif ------- FILE c:\bB\FlagCarRacing.bas.asm ------- FILE 2600basic_variable_redefs.h LEVEL 2 PASS 2 0 3000 ???? include "2600basic_variable_redefs.h" 1 3000 ???? ; This file contains variable mapping and other information for the current project. 2 3000 ???? 3 3000 ???? 00 20 bscode_length = 32 4 3000 ???? 00 e2 dead_counter = m 5 3000 ???? 6 3000 ???? 00 e1 crash_counter = l 7 3000 ???? 8 3000 ???? 00 e0 bassvol = k 9 3000 ???? 10 3000 ???? 00 df bassfreq = j 11 3000 ???? 12 3000 ???? 00 de mdelaycounter = i 13 3000 ???? 14 3000 ???? 00 dd mindex = h 15 3000 ???? 16 3000 ???? 00 dc gameFrames = g 17 3000 ???? 18 3000 ???? 00 db playfield_design = f 19 3000 ???? 20 3000 ???? 00 da player1_frame = e 21 3000 ???? 22 3000 ???? 00 d9 player1_design = d 23 3000 ???? 24 3000 ???? 00 d8 player0_frame = c 25 3000 ???? 26 3000 ???? 00 d7 player0_design = b 27 3000 ???? 28 3000 ???? 00 d6 level_value = a 29 3000 ???? 30 3000 ???? 00 90 _Music1_length = .skipL012-_Music1 31 3000 ???? 32 3000 ???? 00 5c _Music0_length = .skipL011-_Music0 33 3000 ???? 34 3000 ???? 00 01 Metroid_EnergyTank = 1 35 3000 ???? 36 3000 ???? 00 00 Flag = 0 37 3000 ???? 38 3000 ???? 00 01 pfscore = 1 39 3000 ???? 40 3000 ???? 00 2b vblank_time = 43 41 3000 ???? 00 25 overscan_time = 37 42 3000 ???? 00 01 superchip = 1 43 3000 ???? 00 01 bs_mask = 1 44 3000 ???? 00 08 bankswitch = 8 45 3000 ???? 1f f8 bankswitch_hotspot = $1FF8 46 3000 ???? 00 01 no_blank_lines = 1 47 3000 ???? 00 01 player1colors = 1 ------- FILE c:\bB\FlagCarRacing.bas.asm 6 3000 ???? ifconst bankswitch 7 3000 ???? if bankswitch == 8 8 1000 ORG $1000 9 1000 RORG $D000 10 1000 endif 11 1000 - if bankswitch == 16 12 1000 - ORG $1000 13 1000 - RORG $9000 14 1000 endif 15 1000 - if bankswitch == 32 16 1000 - ORG $1000 17 1000 - RORG $1000 18 1000 endif 19 1000 - if bankswitch == 64 20 1000 - ORG $1000 21 1000 - RORG $1000 22 1000 endif 23 1000 - else 24 1000 - ORG $F000 25 1000 endif 26 1000 repeat 256 27 1000 ff .byte.b $ff 26 1000 repend 27 1001 ff .byte.b $ff 26 1001 repend 27 1002 ff .byte.b $ff 26 1002 repend 27 1003 ff .byte.b $ff 26 1003 repend 27 1004 ff .byte.b $ff 26 1004 repend 27 1005 ff .byte.b $ff 26 1005 repend 27 1006 ff .byte.b $ff 26 1006 repend 27 1007 ff .byte.b $ff 26 1007 repend 27 1008 ff .byte.b $ff 26 1008 repend 27 1009 ff .byte.b $ff 26 1009 repend 27 100a ff .byte.b $ff 26 100a repend 27 100b ff .byte.b $ff 26 100b repend 27 100c ff .byte.b $ff 26 100c repend 27 100d ff .byte.b $ff 26 100d repend 27 100e ff .byte.b $ff 26 100e repend 27 100f ff .byte.b $ff 26 100f repend 27 1010 ff .byte.b $ff 26 1010 repend 27 1011 ff .byte.b $ff 26 1011 repend 27 1012 ff .byte.b $ff 26 1012 repend 27 1013 ff .byte.b $ff 26 1013 repend 27 1014 ff .byte.b $ff 26 1014 repend 27 1015 ff .byte.b $ff 26 1015 repend 27 1016 ff .byte.b $ff 26 1016 repend 27 1017 ff .byte.b $ff 26 1017 repend 27 1018 ff .byte.b $ff 26 1018 repend 27 1019 ff .byte.b $ff 26 1019 repend 27 101a ff .byte.b $ff 26 101a repend 27 101b ff .byte.b $ff 26 101b repend 27 101c ff .byte.b $ff 26 101c repend 27 101d ff .byte.b $ff 26 101d repend 27 101e ff .byte.b $ff 26 101e repend 27 101f ff .byte.b $ff 26 101f repend 27 1020 ff .byte.b $ff 26 1020 repend 27 1021 ff .byte.b $ff 26 1021 repend 27 1022 ff .byte.b $ff 26 1022 repend 27 1023 ff .byte.b $ff 26 1023 repend 27 1024 ff .byte.b $ff 26 1024 repend 27 1025 ff .byte.b $ff 26 1025 repend 27 1026 ff .byte.b $ff 26 1026 repend 27 1027 ff .byte.b $ff 26 1027 repend 27 1028 ff .byte.b $ff 26 1028 repend 27 1029 ff .byte.b $ff 26 1029 repend 27 102a ff .byte.b $ff 26 102a repend 27 102b ff .byte.b $ff 26 102b repend 27 102c ff .byte.b $ff 26 102c repend 27 102d ff .byte.b $ff 26 102d repend 27 102e ff .byte.b $ff 26 102e repend 27 102f ff .byte.b $ff 26 102f repend 27 1030 ff .byte.b $ff 26 1030 repend 27 1031 ff .byte.b $ff 26 1031 repend 27 1032 ff .byte.b $ff 26 1032 repend 27 1033 ff .byte.b $ff 26 1033 repend 27 1034 ff .byte.b $ff 26 1034 repend 27 1035 ff .byte.b $ff 26 1035 repend 27 1036 ff .byte.b $ff 26 1036 repend 27 1037 ff .byte.b $ff 26 1037 repend 27 1038 ff .byte.b $ff 26 1038 repend 27 1039 ff .byte.b $ff 26 1039 repend 27 103a ff .byte.b $ff 26 103a repend 27 103b ff .byte.b $ff 26 103b repend 27 103c ff .byte.b $ff 26 103c repend 27 103d ff .byte.b $ff 26 103d repend 27 103e ff .byte.b $ff 26 103e repend 27 103f ff .byte.b $ff 26 103f repend 27 1040 ff .byte.b $ff 26 1040 repend 27 1041 ff .byte.b $ff 26 1041 repend 27 1042 ff .byte.b $ff 26 1042 repend 27 1043 ff .byte.b $ff 26 1043 repend 27 1044 ff .byte.b $ff 26 1044 repend 27 1045 ff .byte.b $ff 26 1045 repend 27 1046 ff .byte.b $ff 26 1046 repend 27 1047 ff .byte.b $ff 26 1047 repend 27 1048 ff .byte.b $ff 26 1048 repend 27 1049 ff .byte.b $ff 26 1049 repend 27 104a ff .byte.b $ff 26 104a repend 27 104b ff .byte.b $ff 26 104b repend 27 104c ff .byte.b $ff 26 104c repend 27 104d ff .byte.b $ff 26 104d repend 27 104e ff .byte.b $ff 26 104e repend 27 104f ff .byte.b $ff 26 104f repend 27 1050 ff .byte.b $ff 26 1050 repend 27 1051 ff .byte.b $ff 26 1051 repend 27 1052 ff .byte.b $ff 26 1052 repend 27 1053 ff .byte.b $ff 26 1053 repend 27 1054 ff .byte.b $ff 26 1054 repend 27 1055 ff .byte.b $ff 26 1055 repend 27 1056 ff .byte.b $ff 26 1056 repend 27 1057 ff .byte.b $ff 26 1057 repend 27 1058 ff .byte.b $ff 26 1058 repend 27 1059 ff .byte.b $ff 26 1059 repend 27 105a ff .byte.b $ff 26 105a repend 27 105b ff .byte.b $ff 26 105b repend 27 105c ff .byte.b $ff 26 105c repend 27 105d ff .byte.b $ff 26 105d repend 27 105e ff .byte.b $ff 26 105e repend 27 105f ff .byte.b $ff 26 105f repend 27 1060 ff .byte.b $ff 26 1060 repend 27 1061 ff .byte.b $ff 26 1061 repend 27 1062 ff .byte.b $ff 26 1062 repend 27 1063 ff .byte.b $ff 26 1063 repend 27 1064 ff .byte.b $ff 26 1064 repend 27 1065 ff .byte.b $ff 26 1065 repend 27 1066 ff .byte.b $ff 26 1066 repend 27 1067 ff .byte.b $ff 26 1067 repend 27 1068 ff .byte.b $ff 26 1068 repend 27 1069 ff .byte.b $ff 26 1069 repend 27 106a ff .byte.b $ff 26 106a repend 27 106b ff .byte.b $ff 26 106b repend 27 106c ff .byte.b $ff 26 106c repend 27 106d ff .byte.b $ff 26 106d repend 27 106e ff .byte.b $ff 26 106e repend 27 106f ff .byte.b $ff 26 106f repend 27 1070 ff .byte.b $ff 26 1070 repend 27 1071 ff .byte.b $ff 26 1071 repend 27 1072 ff .byte.b $ff 26 1072 repend 27 1073 ff .byte.b $ff 26 1073 repend 27 1074 ff .byte.b $ff 26 1074 repend 27 1075 ff .byte.b $ff 26 1075 repend 27 1076 ff .byte.b $ff 26 1076 repend 27 1077 ff .byte.b $ff 26 1077 repend 27 1078 ff .byte.b $ff 26 1078 repend 27 1079 ff .byte.b $ff 26 1079 repend 27 107a ff .byte.b $ff 26 107a repend 27 107b ff .byte.b $ff 26 107b repend 27 107c ff .byte.b $ff 26 107c repend 27 107d ff .byte.b $ff 26 107d repend 27 107e ff .byte.b $ff 26 107e repend 27 107f ff .byte.b $ff 26 107f repend 27 1080 ff .byte.b $ff 26 1080 repend 27 1081 ff .byte.b $ff 26 1081 repend 27 1082 ff .byte.b $ff 26 1082 repend 27 1083 ff .byte.b $ff 26 1083 repend 27 1084 ff .byte.b $ff 26 1084 repend 27 1085 ff .byte.b $ff 26 1085 repend 27 1086 ff .byte.b $ff 26 1086 repend 27 1087 ff .byte.b $ff 26 1087 repend 27 1088 ff .byte.b $ff 26 1088 repend 27 1089 ff .byte.b $ff 26 1089 repend 27 108a ff .byte.b $ff 26 108a repend 27 108b ff .byte.b $ff 26 108b repend 27 108c ff .byte.b $ff 26 108c repend 27 108d ff .byte.b $ff 26 108d repend 27 108e ff .byte.b $ff 26 108e repend 27 108f ff .byte.b $ff 26 108f repend 27 1090 ff .byte.b $ff 26 1090 repend 27 1091 ff .byte.b $ff 26 1091 repend 27 1092 ff .byte.b $ff 26 1092 repend 27 1093 ff .byte.b $ff 26 1093 repend 27 1094 ff .byte.b $ff 26 1094 repend 27 1095 ff .byte.b $ff 26 1095 repend 27 1096 ff .byte.b $ff 26 1096 repend 27 1097 ff .byte.b $ff 26 1097 repend 27 1098 ff .byte.b $ff 26 1098 repend 27 1099 ff .byte.b $ff 26 1099 repend 27 109a ff .byte.b $ff 26 109a repend 27 109b ff .byte.b $ff 26 109b repend 27 109c ff .byte.b $ff 26 109c repend 27 109d ff .byte.b $ff 26 109d repend 27 109e ff .byte.b $ff 26 109e repend 27 109f ff .byte.b $ff 26 109f repend 27 10a0 ff .byte.b $ff 26 10a0 repend 27 10a1 ff .byte.b $ff 26 10a1 repend 27 10a2 ff .byte.b $ff 26 10a2 repend 27 10a3 ff .byte.b $ff 26 10a3 repend 27 10a4 ff .byte.b $ff 26 10a4 repend 27 10a5 ff .byte.b $ff 26 10a5 repend 27 10a6 ff .byte.b $ff 26 10a6 repend 27 10a7 ff .byte.b $ff 26 10a7 repend 27 10a8 ff .byte.b $ff 26 10a8 repend 27 10a9 ff .byte.b $ff 26 10a9 repend 27 10aa ff .byte.b $ff 26 10aa repend 27 10ab ff .byte.b $ff 26 10ab repend 27 10ac ff .byte.b $ff 26 10ac repend 27 10ad ff .byte.b $ff 26 10ad repend 27 10ae ff .byte.b $ff 26 10ae repend 27 10af ff .byte.b $ff 26 10af repend 27 10b0 ff .byte.b $ff 26 10b0 repend 27 10b1 ff .byte.b $ff 26 10b1 repend 27 10b2 ff .byte.b $ff 26 10b2 repend 27 10b3 ff .byte.b $ff 26 10b3 repend 27 10b4 ff .byte.b $ff 26 10b4 repend 27 10b5 ff .byte.b $ff 26 10b5 repend 27 10b6 ff .byte.b $ff 26 10b6 repend 27 10b7 ff .byte.b $ff 26 10b7 repend 27 10b8 ff .byte.b $ff 26 10b8 repend 27 10b9 ff .byte.b $ff 26 10b9 repend 27 10ba ff .byte.b $ff 26 10ba repend 27 10bb ff .byte.b $ff 26 10bb repend 27 10bc ff .byte.b $ff 26 10bc repend 27 10bd ff .byte.b $ff 26 10bd repend 27 10be ff .byte.b $ff 26 10be repend 27 10bf ff .byte.b $ff 26 10bf repend 27 10c0 ff .byte.b $ff 26 10c0 repend 27 10c1 ff .byte.b $ff 26 10c1 repend 27 10c2 ff .byte.b $ff 26 10c2 repend 27 10c3 ff .byte.b $ff 26 10c3 repend 27 10c4 ff .byte.b $ff 26 10c4 repend 27 10c5 ff .byte.b $ff 26 10c5 repend 27 10c6 ff .byte.b $ff 26 10c6 repend 27 10c7 ff .byte.b $ff 26 10c7 repend 27 10c8 ff .byte.b $ff 26 10c8 repend 27 10c9 ff .byte.b $ff 26 10c9 repend 27 10ca ff .byte.b $ff 26 10ca repend 27 10cb ff .byte.b $ff 26 10cb repend 27 10cc ff .byte.b $ff 26 10cc repend 27 10cd ff .byte.b $ff 26 10cd repend 27 10ce ff .byte.b $ff 26 10ce repend 27 10cf ff .byte.b $ff 26 10cf repend 27 10d0 ff .byte.b $ff 26 10d0 repend 27 10d1 ff .byte.b $ff 26 10d1 repend 27 10d2 ff .byte.b $ff 26 10d2 repend 27 10d3 ff .byte.b $ff 26 10d3 repend 27 10d4 ff .byte.b $ff 26 10d4 repend 27 10d5 ff .byte.b $ff 26 10d5 repend 27 10d6 ff .byte.b $ff 26 10d6 repend 27 10d7 ff .byte.b $ff 26 10d7 repend 27 10d8 ff .byte.b $ff 26 10d8 repend 27 10d9 ff .byte.b $ff 26 10d9 repend 27 10da ff .byte.b $ff 26 10da repend 27 10db ff .byte.b $ff 26 10db repend 27 10dc ff .byte.b $ff 26 10dc repend 27 10dd ff .byte.b $ff 26 10dd repend 27 10de ff .byte.b $ff 26 10de repend 27 10df ff .byte.b $ff 26 10df repend 27 10e0 ff .byte.b $ff 26 10e0 repend 27 10e1 ff .byte.b $ff 26 10e1 repend 27 10e2 ff .byte.b $ff 26 10e2 repend 27 10e3 ff .byte.b $ff 26 10e3 repend 27 10e4 ff .byte.b $ff 26 10e4 repend 27 10e5 ff .byte.b $ff 26 10e5 repend 27 10e6 ff .byte.b $ff 26 10e6 repend 27 10e7 ff .byte.b $ff 26 10e7 repend 27 10e8 ff .byte.b $ff 26 10e8 repend 27 10e9 ff .byte.b $ff 26 10e9 repend 27 10ea ff .byte.b $ff 26 10ea repend 27 10eb ff .byte.b $ff 26 10eb repend 27 10ec ff .byte.b $ff 26 10ec repend 27 10ed ff .byte.b $ff 26 10ed repend 27 10ee ff .byte.b $ff 26 10ee repend 27 10ef ff .byte.b $ff 26 10ef repend 27 10f0 ff .byte.b $ff 26 10f0 repend 27 10f1 ff .byte.b $ff 26 10f1 repend 27 10f2 ff .byte.b $ff 26 10f2 repend 27 10f3 ff .byte.b $ff 26 10f3 repend 27 10f4 ff .byte.b $ff 26 10f4 repend 27 10f5 ff .byte.b $ff 26 10f5 repend 27 10f6 ff .byte.b $ff 26 10f6 repend 27 10f7 ff .byte.b $ff 26 10f7 repend 27 10f8 ff .byte.b $ff 26 10f8 repend 27 10f9 ff .byte.b $ff 26 10f9 repend 27 10fa ff .byte.b $ff 26 10fa repend 27 10fb ff .byte.b $ff 26 10fb repend 27 10fc ff .byte.b $ff 26 10fc repend 27 10fd ff .byte.b $ff 26 10fd repend 27 10fe ff .byte.b $ff 26 10fe repend 27 10ff ff .byte.b $ff 28 1100 repend 29 1100 ; y and a contain multiplicands, result in a 30 1100 31 1100 mul8 32 1100 84 9c sty temp1 33 1102 85 9d sta temp2 34 1104 a9 00 lda #0 35 1106 reptmul8 36 1106 46 9d lsr temp2 37 1108 90 03 bcc skipmul8 38 110a 18 clc 39 110b 65 9c adc temp1 40 110d ;bcs donemul8 might save cycles? 41 110d skipmul8 42 110d ;beq donemul8 might save cycles? 43 110d 06 9c asl temp1 44 110f d0 f5 bne reptmul8 45 1111 donemul8 0 1111 RETURN 1 1111 - ifnconst bankswitch 2 1111 - rts 3 1111 else 4 1111 4c dd ff jmp BS_return 5 1114 endif 47 1114 48 1114 div8 49 1114 ; a=numerator y=denominator, result in a 50 1114 c0 02 cpy #2 51 1116 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 52 1118 84 9c sty temp1 53 111a a0 ff ldy #$ff 54 111c div8loop 55 111c e5 9c sbc temp1 56 111e c8 iny 57 111f b0 fb bcs div8loop 58 1121 div8end 59 1121 98 tya 60 1122 ; result in a 0 1122 RETURN 1 1122 - ifnconst bankswitch 2 1122 - rts 3 1122 else 4 1122 4c dd ff jmp BS_return 5 1125 endif 62 1125 game 63 1125 .L00 ; include div_mul.asm 64 1125 65 1125 .L01 ; set kernel_options player1colors no_blank_lines 66 1125 67 1125 .L02 ; set smartbranching on 68 1125 69 1125 .L03 ; set romsize 8kSC 70 1125 71 1125 .L04 ; set tv ntsc 72 1125 73 1125 .L05 ; const pfscore = 1 74 1125 75 1125 . 76 1125 ; 77 1125 78 1125 .L06 ; rem paint pixel 79 1125 80 1125 .L07 ; rem crash pixel dead_counter 81 1125 82 1125 .L08 ; rem flags! verlusst dead 83 1125 84 1125 . 85 1125 ; 86 1125 87 1125 .L09 ; const Flag = 0 88 1125 89 1125 .L010 ; const Metroid_EnergyTank = 1 90 1125 91 1125 . 92 1125 ; 93 1125 94 1125 .L011 ; data _Music0 95 1125 96 1125 4c 84 d1 JMP .skipL011 97 1128 _Music0 98 1128 00 00 0d 0d* .byte.b 0, 0, 13, 13, 15, 15, 15, 15, 18, 20, 23, 23 99 1134 100 1134 17 17 17 17* .byte.b 23, 23, 23, 23, 17, 18, 17, 18, 17, 17, 27, 27 101 1140 102 1140 1b 1b 1f 1f* .byte.b 27, 27, 31, 31, 31, 31, 0, 0, 0, 0, 13, 13, 15, 15, 15, 15 103 1150 104 1150 0b 0b 17 17* .byte.b 11, 11, 23, 23, 18, 18, 18, 18, 20, 20, 24, 24 105 115c 106 115c 1f 1f 1f 1f* .byte.b 31, 31, 31, 31, 23, 27, 0, 23, 27, 0, 23, 27, 0, 0 107 116a 108 116a 14 14 14 14* .byte.b 20, 20, 20, 20, 24, 24, 0, 0, 27, 27, 27, 27 109 1176 110 1176 1f 1f 1f 1f* .byte.b 31, 31, 31, 31, 31, 31, 0, 0, 0, 0, 0, 0, 0, 0 111 1184 112 1184 .skipL011 113 1184 .L012 ; data _Music1 114 1184 115 1184 4c 17 d2 JMP .skipL012 116 1187 _Music1 117 1187 1f 00 0f 00* .byte.b 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0 118 1193 119 1193 1f 1f 00 00* .byte.b 31, 31, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0 120 119f 121 119f 1f 1f 00 00* .byte.b 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0 122 11ab 123 11ab 1f 00 0f 00* .byte.b 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0 124 11b7 125 11b7 1f 1f 00 00* .byte.b 31, 31, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0 126 11c3 127 11c3 1f 1f 00 00* .byte.b 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0 128 11cf 129 11cf 1f 00 0f 00* .byte.b 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0 130 11db 131 11db 1f 1f 00 00* .byte.b 31, 31, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0 132 11e7 133 11e7 1f 1f 00 00* .byte.b 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0 134 11f3 135 11f3 1f 00 0f 00* .byte.b 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0 136 11ff 137 11ff 1f 1f 00 00* .byte.b 31, 31, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0 138 120b 139 120b 1f 1f 00 00* .byte.b 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0 140 1217 141 1217 .skipL012 142 1217 . 143 1217 ; 144 1217 145 1217 .L013 ; rem simple super car racing 146 1217 147 1217 .L014 ; rem Level 1-31 148 1217 149 1217 .L015 ; rem Autorennen in der Stadt 150 1217 151 1217 .L016 ; rem People cross the strett 152 1217 153 1217 . 154 1217 ; 155 1217 156 1217 .L017 ; dim level_value = a 157 1217 158 1217 .L018 ; dim player0_design = b 159 1217 160 1217 .L019 ; dim player0_frame = c 161 1217 162 1217 .L020 ; dim player1_design = d 163 1217 164 1217 .L021 ; dim player1_frame = e 165 1217 166 1217 .L022 ; dim playfield_design = f 167 1217 168 1217 .L023 ; dim gameFrames = g 169 1217 170 1217 . 171 1217 ; 172 1217 173 1217 .L024 ; dim mindex = h 174 1217 175 1217 .L025 ; dim mdelaycounter = i 176 1217 177 1217 .L026 ; dim bassfreq = j 178 1217 179 1217 .L027 ; dim bassvol = k 180 1217 181 1217 . 182 1217 ; 183 1217 184 1217 .L028 ; dim crash_counter = l 185 1217 186 1217 .L029 ; dim dead_counter = m 187 1217 188 1217 . 189 1217 ; 190 1217 191 1217 . 192 1217 ; 193 1217 194 1217 .L030 ; gosub _Control_Playfield_001_Setup 195 1217 196 1217 20 be d5 jsr ._Control_Playfield_001_Setup 197 121a 198 121a .L031 ; gosub _Control_Scorebars_001_Setup 199 121a 200 121a 20 0f d6 jsr ._Control_Scorebars_001_Setup 201 121d 202 121d .L032 ; gosub _level_image_loop 203 121d 204 121d 20 39 d6 jsr ._level_image_loop 205 1220 206 1220 . 207 1220 ; 208 1220 209 1220 .L033 ; gosub _Control_Player0_001_Setup 210 1220 211 1220 20 67 d2 jsr ._Control_Player0_001_Setup 212 1223 213 1223 . 214 1223 ; 215 1223 216 1223 .L034 ; player1_design = 0 217 1223 218 1223 a9 00 LDA #0 219 1225 85 d9 STA player1_design 220 1227 .L035 ; playfield_design = 0 221 1227 222 1227 a9 00 LDA #0 223 1229 85 db STA playfield_design 224 122b . 225 122b ; 226 122b 227 122b .L036 ; gosub _Control_Player1_004_Random_Position 228 122b 229 122b 20 cb d3 jsr ._Control_Player1_004_Random_Position 230 122e 231 122e . 232 122e ; 233 122e 234 122e .gameloop 235 122e ; gameloop 236 122e 237 122e . 238 122e ; 239 122e 240 122e .L037 ; gosub _Control_GameFrames_Control 241 122e 242 122e 20 24 d4 jsr ._Control_GameFrames_Control 243 1231 244 1231 . 245 1231 ; 246 1231 247 1231 .L038 ; gosub _Control_Player1_Moveing 248 1231 249 1231 20 af d3 jsr ._Control_Player1_Moveing 250 1234 251 1234 .L039 ; gosub _Control_Player1_Moveing_Checking 252 1234 253 1234 20 be d3 jsr ._Control_Player1_Moveing_Checking 254 1237 255 1237 . 256 1237 ; 257 1237 258 1237 .L040 ; gosub _Control_Music_Playing 259 1237 260 1237 20 89 d4 jsr ._Control_Music_Playing 261 123a 262 123a . 263 123a ; 264 123a 265 123a .L041 ; rem gosub _Control_Playfield_001_Setup 266 123a 267 123a .L042 ; gosub _Control_Playfield_002_Colors 268 123a 269 123a 20 a9 d5 jsr ._Control_Playfield_002_Colors 270 123d 271 123d .L043 ; gosub _Control_Scorebars_002_Colors 272 123d 273 123d 20 24 d6 jsr ._Control_Scorebars_002_Colors 274 1240 275 1240 . 276 1240 ; 277 1240 278 1240 .L044 ; gosub _Control_Player0_Joystick 279 1240 280 1240 20 e8 d3 jsr ._Control_Player0_Joystick 281 1243 282 1243 .L045 ; gosub _Control_Player0_Painting 283 1243 284 1243 20 68 d5 jsr ._Control_Player0_Painting 285 1246 286 1246 . 287 1246 ; 288 1246 289 1246 .L046 ; gosub _Control_Player1_Painting 290 1246 291 1246 20 1b d5 jsr ._Control_Player1_Painting 292 1249 293 1249 . 294 1249 ; 295 1249 296 1249 .L047 ; gosub _Control_Collision 297 1249 298 1249 20 7c d2 jsr ._Control_Collision 299 124c 300 124c . 301 124c ; 302 124c 303 124c .L048 ; drawscreen 304 124c 305 124c 85 d4 sta temp7 306 124e a9 d2 lda #>(ret_point1-1) 307 1250 48 pha 308 1251 a9 63 lda #<(ret_point1-1) 309 1253 48 pha 310 1254 a9 f5 lda #>(drawscreen-1) 311 1256 48 pha 312 1257 a9 82 lda #<(drawscreen-1) 313 1259 48 pha 314 125a a5 d4 lda temp7 315 125c 48 pha 316 125d 8a txa 317 125e 48 pha 318 125f a2 02 ldx #2 319 1261 4c eb ff jmp BS_jsr 320 1264 ret_point1 321 1264 . 322 1264 ; 323 1264 324 1264 .L049 ; goto gameloop 325 1264 326 1264 4c 2e d2 jmp .gameloop 327 1267 328 1267 . 329 1267 ; 330 1267 331 1267 ._Control_Player0_001_Setup 332 1267 ; _Control_Player0_001_Setup 333 1267 334 1267 .L050 ; player0x = 70 : player0y = 86 335 1267 336 1267 a9 46 LDA #70 337 1269 85 80 STA player0x 338 126b a9 56 LDA #86 339 126d 85 85 STA player0y 340 126f .L051 ; return 341 126f 342 126f ba tsx 343 1270 b5 02 lda 2,x ; check return address 344 1272 49 d2 eor #(>*) ; vs. current PCH 345 1274 29 e0 and #$E0 ; mask off all but top 3 bits 346 1276 f0 03 beq *+5 ; if equal, do normal return 347 1278 4c dd ff JMP BS_return 348 127b 60 RTS 349 127c . 350 127c ; 351 127c 352 127c ._Control_Collision 353 127c ; _Control_Collision 354 127c 355 127c .L052 ; if collision(player0,player1) && player0_design = 0 then gosub _Control_Player1_008_Point 356 127c 357 127c 24 07 bit CXPPMM 358 127e 10 09 BPL .skipL052 359 1280 .condpart0 360 1280 a5 d7 LDA player0_design 361 1282 c9 00 CMP #0 362 1284 d0 03 BNE .skip0then 363 1286 .condpart1 364 1286 20 8a d3 jsr ._Control_Player1_008_Point 365 1289 366 1289 .skip0then 367 1289 .skipL052 368 1289 .L053 ; if collision(player0,player1) && player0_design = 1 then gosub _Control_Player1_008_Dead 369 1289 370 1289 24 07 bit CXPPMM 371 128b 10 09 BPL .skipL053 372 128d .condpart2 373 128d a5 d7 LDA player0_design 374 128f c9 01 CMP #1 375 1291 d0 03 BNE .skip2then 376 1293 .condpart3 377 1293 20 7a d3 jsr ._Control_Player1_008_Dead 378 1296 379 1296 .skip2then 380 1296 .skipL053 381 1296 .L054 ; if collision(player0,playfield) then gosub _Control_Player1_008_Crash_Street 382 1296 383 1296 24 02 bit CXP0FB 384 1298 10 03 BPL .skipL054 385 129a .condpart4 386 129a 20 aa d2 jsr ._Control_Player1_008_Crash_Street 387 129d 388 129d .skipL054 389 129d .L055 ; return 390 129d 391 129d ba tsx 392 129e b5 02 lda 2,x ; check return address 393 12a0 49 d2 eor #(>*) ; vs. current PCH 394 12a2 29 e0 and #$E0 ; mask off all but top 3 bits 395 12a4 f0 03 beq *+5 ; if equal, do normal return 396 12a6 4c dd ff JMP BS_return 397 12a9 60 RTS 398 12aa . 399 12aa ; 400 12aa 401 12aa ._Control_Player1_008_Crash_Street 402 12aa ; _Control_Player1_008_Crash_Street 403 12aa 404 12aa .L056 ; pfscore2 = pfscore2 / 2 405 12aa 406 12aa a5 f3 LDA pfscore2 407 12ac 4a lsr 408 12ad 85 f3 STA pfscore2 409 12af .L057 ; gosub _Control_Player0_001_Setup 410 12af 411 12af 20 67 d2 jsr ._Control_Player0_001_Setup 412 12b2 413 12b2 .L058 ; crash_counter = crash_counter + 1 414 12b2 415 12b2 e6 e1 INC crash_counter 416 12b4 .L059 ; if crash_counter = 7 then pfscore2 = %11111111 : gosub _Control_Player1_032_Dead 417 12b4 418 12b4 a5 e1 LDA crash_counter 419 12b6 c9 07 CMP #7 420 12b8 d0 07 BNE .skipL059 421 12ba .condpart5 422 12ba a9 ff LDA #%11111111 423 12bc 85 f3 STA pfscore2 424 12be 20 ce d2 jsr ._Control_Player1_032_Dead 425 12c1 426 12c1 .skipL059 427 12c1 .L060 ; return 428 12c1 429 12c1 ba tsx 430 12c2 b5 02 lda 2,x ; check return address 431 12c4 49 d2 eor #(>*) ; vs. current PCH 432 12c6 29 e0 and #$E0 ; mask off all but top 3 bits 433 12c8 f0 03 beq *+5 ; if equal, do normal return 434 12ca 4c dd ff JMP BS_return 435 12cd 60 RTS 436 12ce . 437 12ce ; 438 12ce 439 12ce ._Control_Player1_032_Dead 440 12ce ; _Control_Player1_032_Dead 441 12ce 442 12ce .L061 ; pfscore1 = pfscore1 / 2 443 12ce 444 12ce a5 f2 LDA pfscore1 445 12d0 4a lsr 446 12d1 85 f2 STA pfscore1 447 12d3 .L062 ; dead_counter = dead_counter + 1 448 12d3 449 12d3 e6 e2 INC dead_counter 450 12d5 .L063 ; crash_counter = 0 451 12d5 452 12d5 a9 00 LDA #0 453 12d7 85 e1 STA crash_counter 454 12d9 .L064 ; if dead_counter = 2 then goto _Control_Player1_032_Game_Over 455 12d9 456 12d9 a5 e2 LDA dead_counter 457 12db c9 02 CMP #2 458 12dd d0 03 BNE .skipL064 459 12df .condpart6 460 12df 4c ef d2 jmp ._Control_Player1_032_Game_Over 461 12e2 462 12e2 .skipL064 463 12e2 .L065 ; return 464 12e2 465 12e2 ba tsx 466 12e3 b5 02 lda 2,x ; check return address 467 12e5 49 d2 eor #(>*) ; vs. current PCH 468 12e7 29 e0 and #$E0 ; mask off all but top 3 bits 469 12e9 f0 03 beq *+5 ; if equal, do normal return 470 12eb 4c dd ff JMP BS_return 471 12ee 60 RTS 472 12ef . 473 12ef ; 474 12ef 475 12ef ._Control_Player1_032_Game_Over 476 12ef ; _Control_Player1_032_Game_Over 477 12ef 478 12ef .L066 ; dead_counter = 0 479 12ef 480 12ef a9 00 LDA #0 481 12f1 85 e2 STA dead_counter 482 12f3 .L067 ; crash_counter = 0 483 12f3 484 12f3 a9 00 LDA #0 485 12f5 85 e1 STA crash_counter 486 12f7 .L068 ; pfclear 487 12f7 488 12f7 a9 00 LDA #0 489 12f9 85 d4 sta temp7 490 12fb a9 d3 lda #>(ret_point2-1) 491 12fd 48 pha 492 12fe a9 10 lda #<(ret_point2-1) 493 1300 48 pha 494 1301 a9 f3 lda #>(pfclear-1) 495 1303 48 pha 496 1304 a9 8f lda #<(pfclear-1) 497 1306 48 pha 498 1307 a5 d4 lda temp7 499 1309 48 pha 500 130a 8a txa 501 130b 48 pha 502 130c a2 02 ldx #2 503 130e 4c eb ff jmp BS_jsr 504 1311 ret_point2 505 1311 .L069 ; playfield: 506 1311 507 1311 - ifconst pfres 508 1311 - ldx #(11>pfres)*(pfres*pfwidth-1)+(11<=pfres)*43 509 1311 else 510 1311 a2 2b ldx #((11*pfwidth-1)*((11*pfwidth-1)<47))+(47*((11*pfwidth-1)>=47)) 511 1313 endif 512 1313 4c 42 d3 jmp pflabel0 513 1316 PF_data0 514 1316 7d 43 .byte.b %01111101, %01000011 515 1318 if (pfwidth>2) 516 1318 83 01 .byte.b %10000011, %00000001 517 131a endif 518 131a 41 a2 .byte.b %01000001, %10100010 519 131c if (pfwidth>2) 520 131c 42 00 .byte.b %01000010, %00000000 521 131e endif 522 131e 4d 93 .byte.b %01001101, %10010011 523 1320 if (pfwidth>2) 524 1320 23 01 .byte.b %00100011, %00000001 525 1322 endif 526 1322 45 0a .byte.b %01000101, %00001010 527 1324 if (pfwidth>2) 528 1324 12 00 .byte.b %00010010, %00000000 529 1326 endif 530 1326 7d 0a .byte.b %01111101, %00001010 531 1328 if (pfwidth>2) 532 1328 13 01 .byte.b %00010011, %00000001 533 132a endif 534 132a 00 00 .byte.b %00000000, %00000000 535 132c if (pfwidth>2) 536 132c 00 00 .byte.b %00000000, %00000000 537 132e endif 538 132e 7a 74 .byte.b %01111010, %01110100 539 1330 if (pfwidth>2) 540 1330 c0 00 .byte.b %11000000, %00000000 541 1332 endif 542 1332 4a 14 .byte.b %01001010, %00010100 543 1334 if (pfwidth>2) 544 1334 a0 00 .byte.b %10100000, %00000000 545 1336 endif 546 1336 49 72 .byte.b %01001001, %01110010 547 1338 if (pfwidth>2) 548 1338 a0 00 .byte.b %10100000, %00000000 549 133a endif 550 133a 49 12 .byte.b %01001001, %00010010 551 133c if (pfwidth>2) 552 133c c0 00 .byte.b %11000000, %00000000 553 133e endif 554 133e 78 71 .byte.b %01111000, %01110001 555 1340 if (pfwidth>2) 556 1340 a0 00 .byte.b %10100000, %00000000 557 1342 endif 558 1342 pflabel0 559 1342 bd 16 d3 lda PF_data0,x 560 1345 9d 50 10 sta playfield-128,x 561 1348 ca dex 562 1349 10 f7 bpl pflabel0 563 134b .game_game_over 564 134b ; game_game_over 565 134b 566 134b . 567 134b ; 568 134b 569 134b .L070 ; if joy0fire then goto _Control_002_GAMESTATUS____________________________________ROUTINES 570 134b 571 134b 24 0c bit INPT4 572 134d 30 03 BMI .skipL070 573 134f .condpart7 574 134f 4c 39 d6 jmp ._Control_002_GAMESTATUS____________________________________ROUTINES 575 1352 576 1352 .skipL070 577 1352 . 578 1352 ; 579 1352 580 1352 .L071 ; drawscreen 581 1352 582 1352 85 d4 sta temp7 583 1354 a9 d3 lda #>(ret_point3-1) 584 1356 48 pha 585 1357 a9 69 lda #<(ret_point3-1) 586 1359 48 pha 587 135a a9 f5 lda #>(drawscreen-1) 588 135c 48 pha 589 135d a9 82 lda #<(drawscreen-1) 590 135f 48 pha 591 1360 a5 d4 lda temp7 592 1362 48 pha 593 1363 8a txa 594 1364 48 pha 595 1365 a2 02 ldx #2 596 1367 4c eb ff jmp BS_jsr 597 136a ret_point3 598 136a . 599 136a ; 600 136a 601 136a .L072 ; goto game_game_over 602 136a 603 136a 4c 4b d3 jmp .game_game_over 604 136d 605 136d .L073 ; return 606 136d 607 136d ba tsx 608 136e b5 02 lda 2,x ; check return address 609 1370 49 d3 eor #(>*) ; vs. current PCH 610 1372 29 e0 and #$E0 ; mask off all but top 3 bits 611 1374 f0 03 beq *+5 ; if equal, do normal return 612 1376 4c dd ff JMP BS_return 613 1379 60 RTS 614 137a . 615 137a ; 616 137a 617 137a . 618 137a ; 619 137a 620 137a ._Control_Player1_008_Dead 621 137a ; _Control_Player1_008_Dead 622 137a 623 137a .L074 ; gosub _Control_Player1_004_Random_Position 624 137a 625 137a 20 cb d3 jsr ._Control_Player1_004_Random_Position 626 137d 627 137d .L075 ; return 628 137d 629 137d ba tsx 630 137e b5 02 lda 2,x ; check return address 631 1380 49 d3 eor #(>*) ; vs. current PCH 632 1382 29 e0 and #$E0 ; mask off all but top 3 bits 633 1384 f0 03 beq *+5 ; if equal, do normal return 634 1386 4c dd ff JMP BS_return 635 1389 60 RTS 636 138a . 637 138a ; 638 138a 639 138a . 640 138a ; 641 138a 642 138a ._Control_Player1_008_Point 643 138a ; _Control_Player1_008_Point 644 138a 645 138a .L076 ; gosub _Control_Player1_004_Random_Position 646 138a 647 138a 20 cb d3 jsr ._Control_Player1_004_Random_Position 648 138d 649 138d .L077 ; score = score + 10 650 138d 651 138d f8 SED 652 138e 18 CLC 653 138f a5 95 LDA score+2 654 1391 69 10 ADC #$10 655 1393 85 95 STA score+2 656 1395 a5 94 LDA score+1 657 1397 69 00 ADC #$00 658 1399 85 94 STA score+1 659 139b a5 93 LDA score 660 139d 69 00 ADC #$00 661 139f 85 93 STA score 662 13a1 d8 CLD 663 13a2 .L078 ; return 664 13a2 665 13a2 ba tsx 666 13a3 b5 02 lda 2,x ; check return address 667 13a5 49 d3 eor #(>*) ; vs. current PCH 668 13a7 29 e0 and #$E0 ; mask off all but top 3 bits 669 13a9 f0 03 beq *+5 ; if equal, do normal return 670 13ab 4c dd ff JMP BS_return 671 13ae 60 RTS 672 13af . 673 13af ; 674 13af 675 13af ._Control_Player1_Moveing 676 13af ; _Control_Player1_Moveing 677 13af 678 13af .L079 ; player1y = player1y + 1 679 13af 680 13af e6 86 INC player1y 681 13b1 .L080 ; return 682 13b1 683 13b1 ba tsx 684 13b2 b5 02 lda 2,x ; check return address 685 13b4 49 d3 eor #(>*) ; vs. current PCH 686 13b6 29 e0 and #$E0 ; mask off all but top 3 bits 687 13b8 f0 03 beq *+5 ; if equal, do normal return 688 13ba 4c dd ff JMP BS_return 689 13bd 60 RTS 690 13be . 691 13be ; 692 13be 693 13be ._Control_Player1_Moveing_Checking 694 13be ; _Control_Player1_Moveing_Checking 695 13be 696 13be .L081 ; rem wer schafft es 697 13be 698 13be .L082 ; return 699 13be 700 13be ba tsx 701 13bf b5 02 lda 2,x ; check return address 702 13c1 49 d3 eor #(>*) ; vs. current PCH 703 13c3 29 e0 and #$E0 ; mask off all but top 3 bits 704 13c5 f0 03 beq *+5 ; if equal, do normal return 705 13c7 4c dd ff JMP BS_return 706 13ca 60 RTS 707 13cb . 708 13cb ; 709 13cb 710 13cb . 711 13cb ; 712 13cb 713 13cb ._Control_Player1_004_Random_Position 714 13cb ; _Control_Player1_004_Random_Position 715 13cb 716 13cb .L083 ; temp5 = 50 717 13cb 718 13cb a9 32 LDA #50 719 13cd 85 a0 STA temp5 720 13cf .L084 ; temp6 = 25 721 13cf 722 13cf a9 19 LDA #25 723 13d1 85 a1 STA temp6 724 13d3 .L085 ; player1x = temp5 725 13d3 726 13d3 a5 a0 LDA temp5 727 13d5 85 81 STA player1x 728 13d7 .L086 ; player1y = temp6 729 13d7 730 13d7 a5 a1 LDA temp6 731 13d9 85 86 STA player1y 732 13db .L087 ; return 733 13db 734 13db ba tsx 735 13dc b5 02 lda 2,x ; check return address 736 13de 49 d3 eor #(>*) ; vs. current PCH 737 13e0 29 e0 and #$E0 ; mask off all but top 3 bits 738 13e2 f0 03 beq *+5 ; if equal, do normal return 739 13e4 4c dd ff JMP BS_return 740 13e7 60 RTS 741 13e8 . 742 13e8 ; 743 13e8 744 13e8 . 745 13e8 ; 746 13e8 747 13e8 ._Control_Player0_Joystick 748 13e8 ; _Control_Player0_Joystick 749 13e8 750 13e8 .L088 ; if joy0left then player0x = player0x - 1 751 13e8 752 13e8 2c 80 02 bit SWCHA 753 13eb 70 02 BVS .skipL088 754 13ed .condpart8 755 13ed c6 80 DEC player0x 756 13ef .skipL088 757 13ef .L089 ; if joy0right then player0x = player0x + 1 758 13ef 759 13ef 2c 80 02 bit SWCHA 760 13f2 30 02 BMI .skipL089 761 13f4 .condpart9 762 13f4 e6 80 INC player0x 763 13f6 .skipL089 764 13f6 .L090 ; if joy0up then pfscroll down 765 13f6 766 13f6 a9 10 lda #$10 767 13f8 2c 80 02 bit SWCHA 768 13fb d0 1a BNE .skipL090 769 13fd .condpart10 770 13fd a9 04 LDA #4 771 13ff 85 d4 sta temp7 772 1401 a9 d4 lda #>(ret_point4-1) 773 1403 48 pha 774 1404 a9 16 lda #<(ret_point4-1) 775 1406 48 pha 776 1407 a9 f4 lda #>(pfscroll-1) 777 1409 48 pha 778 140a a9 64 lda #<(pfscroll-1) 779 140c 48 pha 780 140d a5 d4 lda temp7 781 140f 48 pha 782 1410 8a txa 783 1411 48 pha 784 1412 a2 02 ldx #2 785 1414 4c eb ff jmp BS_jsr 786 1417 ret_point4 787 1417 .skipL090 788 1417 .L091 ; return 789 1417 790 1417 ba tsx 791 1418 b5 02 lda 2,x ; check return address 792 141a 49 d4 eor #(>*) ; vs. current PCH 793 141c 29 e0 and #$E0 ; mask off all but top 3 bits 794 141e f0 03 beq *+5 ; if equal, do normal return 795 1420 4c dd ff JMP BS_return 796 1423 60 RTS 797 1424 . 798 1424 ; 799 1424 800 1424 ._Control_GameFrames_Control 801 1424 ; _Control_GameFrames_Control 802 1424 803 1424 .L092 ; pfscroll down 804 1424 805 1424 a9 04 LDA #4 806 1426 85 d4 sta temp7 807 1428 a9 d4 lda #>(ret_point5-1) 808 142a 48 pha 809 142b a9 3d lda #<(ret_point5-1) 810 142d 48 pha 811 142e a9 f4 lda #>(pfscroll-1) 812 1430 48 pha 813 1431 a9 64 lda #<(pfscroll-1) 814 1433 48 pha 815 1434 a5 d4 lda temp7 816 1436 48 pha 817 1437 8a txa 818 1438 48 pha 819 1439 a2 02 ldx #2 820 143b 4c eb ff jmp BS_jsr 821 143e ret_point5 822 143e .L093 ; gameFrames = gameFrames + 1 823 143e 824 143e e6 dc INC gameFrames 825 1440 .L094 ; if gameFrames = 5 then pfscroll downdown 826 1440 827 1440 a5 dc LDA gameFrames 828 1442 c9 05 CMP #5 829 1444 d0 1a BNE .skipL094 830 1446 .condpart11 831 1446 a9 08 LDA #8 832 1448 85 d4 sta temp7 833 144a a9 d4 lda #>(ret_point6-1) 834 144c 48 pha 835 144d a9 5f lda #<(ret_point6-1) 836 144f 48 pha 837 1450 a9 f4 lda #>(pfscroll-1) 838 1452 48 pha 839 1453 a9 64 lda #<(pfscroll-1) 840 1455 48 pha 841 1456 a5 d4 lda temp7 842 1458 48 pha 843 1459 8a txa 844 145a 48 pha 845 145b a2 02 ldx #2 846 145d 4c eb ff jmp BS_jsr 847 1460 ret_point6 848 1460 .skipL094 849 1460 .L095 ; if gameFrames = 10 then player0_frame = player0_frame + 1 : gameFrames = 0 850 1460 851 1460 a5 dc LDA gameFrames 852 1462 c9 0a CMP #10 853 1464 d0 06 BNE .skipL095 854 1466 .condpart12 855 1466 e6 d8 INC player0_frame 856 1468 a9 00 LDA #0 857 146a 85 dc STA gameFrames 858 146c .skipL095 859 146c .L096 ; if player0_design = 0 && player0_frame > 2 then player0_frame = 0 860 146c 861 146c a5 d7 LDA player0_design 862 146e c9 00 CMP #0 863 1470 d0 0a BNE .skipL096 864 1472 .condpart13 865 1472 a9 02 LDA #2 866 1474 c5 d8 CMP player0_frame 867 1476 b0 04 BCS .skip13then 868 1478 .condpart14 869 1478 a9 00 LDA #0 870 147a 85 d8 STA player0_frame 871 147c .skip13then 872 147c .skipL096 873 147c .L097 ; return 874 147c 875 147c ba tsx 876 147d b5 02 lda 2,x ; check return address 877 147f 49 d4 eor #(>*) ; vs. current PCH 878 1481 29 e0 and #$E0 ; mask off all but top 3 bits 879 1483 f0 03 beq *+5 ; if equal, do normal return 880 1485 4c dd ff JMP BS_return 881 1488 60 RTS 882 1489 . 883 1489 ; 884 1489 885 1489 ._Control_Music_Playing 886 1489 ; _Control_Music_Playing 887 1489 888 1489 .L098 ; mdelaycounter = mdelaycounter + 1 : if mdelaycounter > 8 then mdelaycounter = 0 889 1489 890 1489 e6 de INC mdelaycounter 891 148b a9 08 LDA #8 892 148d c5 de CMP mdelaycounter 893 148f b0 04 BCS .skipL098 894 1491 .condpart15 895 1491 a9 00 LDA #0 896 1493 85 de STA mdelaycounter 897 1495 .skipL098 898 1495 .L099 ; if mdelaycounter > 0 then goto aftermusic 899 1495 900 1495 a9 00 LDA #0 901 1497 c5 de CMP mdelaycounter 902 1499 b0 03 BCS .skipL099 903 149b .condpart16 904 149b 4c 0e d5 jmp .aftermusic 905 149e 906 149e .skipL099 907 149e .L0100 ; AUDC0 = 4 908 149e 909 149e a9 04 LDA #4 910 14a0 85 15 STA AUDC0 911 14a2 .L0101 ; temp7 = _Music0[mindex] 912 14a2 913 14a2 a6 dd LDX mindex 914 14a4 bd 28 d1 LDA _Music0,x 915 14a7 85 d4 STA temp7 916 14a9 .L0102 ; if temp7 > 0 then temp6 = 8 else temp6 = 0 917 14a9 918 14a9 a9 00 LDA #0 919 14ab c5 d4 CMP temp7 920 14ad b0 07 BCS .skipL0102 921 14af .condpart17 922 14af a9 08 LDA #8 923 14b1 85 a1 STA temp6 924 14b3 4c ba d4 jmp .skipelse0 925 14b6 .skipL0102 926 14b6 a9 00 LDA #0 927 14b8 85 a1 STA temp6 928 14ba .skipelse0 929 14ba .L0103 ; AUDF0 = temp7 930 14ba 931 14ba a5 d4 LDA temp7 932 14bc 85 17 STA AUDF0 933 14be .L0104 ; AUDV0 = 4 : rem temp6 934 14be 935 14be a9 04 LDA #4 936 14c0 85 19 STA AUDV0 937 14c2 .L0105 ; AUDC1 = 12 938 14c2 939 14c2 a9 0c LDA #12 940 14c4 85 16 STA AUDC1 941 14c6 .L0106 ; temp7 = _Music1[mindex] 942 14c6 943 14c6 a6 dd LDX mindex 944 14c8 bd 87 d1 LDA _Music1,x 945 14cb 85 d4 STA temp7 946 14cd .L0107 ; if temp7 > 0 then bassvol = 4 : bassfreq = temp7 947 14cd 948 14cd a9 00 LDA #0 949 14cf c5 d4 CMP temp7 950 14d1 b0 08 BCS .skipL0107 951 14d3 .condpart18 952 14d3 a9 04 LDA #4 953 14d5 85 e0 STA bassvol 954 14d7 a5 d4 LDA temp7 955 14d9 85 df STA bassfreq 956 14db .skipL0107 957 14db .L0108 ; AUDF1 = bassfreq 958 14db 959 14db a5 df LDA bassfreq 960 14dd 85 18 STA AUDF1 961 14df .L0109 ; AUDV1 = bassvol 962 14df 963 14df a5 e0 LDA bassvol 964 14e1 85 1a STA AUDV1 965 14e3 .L0110 ; if bassvol > 0 then bassvol = bassvol - 1 : if mindex > 80 then bassvol = bassvol - 2 966 14e3 967 14e3 a9 00 LDA #0 968 14e5 c5 e0 CMP bassvol 969 14e7 b0 0f BCS .skipL0110 970 14e9 .condpart19 971 14e9 c6 e0 DEC bassvol 972 14eb a9 50 LDA #80 973 14ed c5 dd CMP mindex 974 14ef b0 07 BCS .skip19then 975 14f1 .condpart20 976 14f1 a5 e0 LDA bassvol 977 14f3 38 SEC 978 14f4 e9 02 SBC #2 979 14f6 85 e0 STA bassvol 980 14f8 .skip19then 981 14f8 .skipL0110 982 14f8 .L0111 ; if bassvol > 200 then bassvol = 0 983 14f8 984 14f8 a9 c8 LDA #200 985 14fa c5 e0 CMP bassvol 986 14fc b0 04 BCS .skipL0111 987 14fe .condpart21 988 14fe a9 00 LDA #0 989 1500 85 e0 STA bassvol 990 1502 .skipL0111 991 1502 .L0112 ; mindex = mindex + 1 : if mindex > 87 then mindex = 0 992 1502 993 1502 e6 dd INC mindex 994 1504 a9 57 LDA #87 995 1506 c5 dd CMP mindex 996 1508 b0 04 BCS .skipL0112 997 150a .condpart22 998 150a a9 00 LDA #0 999 150c 85 dd STA mindex 1000 150e .skipL0112 1001 150e .aftermusic 1002 150e ; aftermusic 1003 150e 1004 150e .L0113 ; return 1005 150e 1006 150e ba tsx 1007 150f b5 02 lda 2,x ; check return address 1008 1511 49 d5 eor #(>*) ; vs. current PCH 1009 1513 29 e0 and #$E0 ; mask off all but top 3 bits 1010 1515 f0 03 beq *+5 ; if equal, do normal return 1011 1517 4c dd ff JMP BS_return 1012 151a 60 RTS 1013 151b . 1014 151b ; 1015 151b 1016 151b . 1017 151b ; 1018 151b 1019 151b . 1020 151b ; 1021 151b 1022 151b ._Control_Player1_Painting 1023 151b ; _Control_Player1_Painting 1024 151b 1025 151b .L0114 ; if player1_design = Flag then player1: 1026 151b 1027 151b a5 d9 LDA player1_design 1028 151d c9 00 CMP #Flag 1029 151f d0 0c BNE .skipL0114 1030 1521 .condpart23 1031 1521 a2 23 LDX #player23then_1 1034 1527 85 8d STA player1pointerhi 1035 1529 a9 07 LDA #7 1036 152b 85 8f STA player1height 1037 152d .skipL0114 1038 152d .L0115 ; if player1_design = Flag then player1color: 1039 152d 1040 152d a5 d9 LDA player1_design 1041 152f c9 00 CMP #Flag 1042 1531 d0 08 BNE .skipL0115 1043 1533 .condpart24 1044 1533 a2 2b LDX #playercolor24then_1 1047 1539 85 88 STA player1color+1 1048 153b .skipL0115 1049 153b . 1050 153b ; 1051 153b 1052 153b .L0116 ; if player1_design = Metroid_EnergyTank then player1color: 1053 153b 1054 153b a5 d9 LDA player1_design 1055 153d c9 01 CMP #Metroid_EnergyTank 1056 153f d0 08 BNE .skipL0116 1057 1541 .condpart25 1058 1541 a2 34 LDX #playercolor25then_1 1061 1547 85 88 STA player1color+1 1062 1549 .skipL0116 1063 1549 .L0117 ; if player1_design = Metroid_EnergyTank then player1: 1064 1549 1065 1549 a5 d9 LDA player1_design 1066 154b c9 01 CMP #Metroid_EnergyTank 1067 154d d0 0c BNE .skipL0117 1068 154f .condpart26 1069 154f a2 3f LDX #player26then_1 1072 1555 85 8d STA player1pointerhi 1073 1557 a9 0a LDA #10 1074 1559 85 8f STA player1height 1075 155b .skipL0117 1076 155b .L0118 ; return 1077 155b 1078 155b ba tsx 1079 155c b5 02 lda 2,x ; check return address 1080 155e 49 d5 eor #(>*) ; vs. current PCH 1081 1560 29 e0 and #$E0 ; mask off all but top 3 bits 1082 1562 f0 03 beq *+5 ; if equal, do normal return 1083 1564 4c dd ff JMP BS_return 1084 1567 60 RTS 1085 1568 . 1086 1568 ; 1087 1568 1088 1568 . 1089 1568 ; 1090 1568 1091 1568 ._Control_Player0_Painting 1092 1568 ; _Control_Player0_Painting 1093 1568 1094 1568 .L0119 ; COLUP0 = $60 1095 1568 1096 1568 a9 60 LDA #$60 1097 156a 85 06 STA COLUP0 1098 156c .L0120 ; if player0_design = 0 && player0_frame = 0 then player0: 1099 156c 1100 156c a5 d7 LDA player0_design 1101 156e c9 00 CMP #0 1102 1570 d0 12 BNE .skipL0120 1103 1572 .condpart27 1104 1572 a5 d8 LDA player0_frame 1105 1574 c9 00 CMP #0 1106 1576 d0 0c BNE .skip27then 1107 1578 .condpart28 1108 1578 a2 4a LDX #player28then_0 1111 157e 85 8b STA player0pointerhi 1112 1580 a9 0a LDA #10 1113 1582 85 8e STA player0height 1114 1584 .skip27then 1115 1584 .skipL0120 1116 1584 .L0121 ; if player0_design = 0 && player0_frame = 1 then player0: 1117 1584 1118 1584 a5 d7 LDA player0_design 1119 1586 c9 00 CMP #0 1120 1588 d0 12 BNE .skipL0121 1121 158a .condpart29 1122 158a a5 d8 LDA player0_frame 1123 158c c9 01 CMP #1 1124 158e d0 0c BNE .skip29then 1125 1590 .condpart30 1126 1590 a2 55 LDX #player30then_0 1129 1596 85 8b STA player0pointerhi 1130 1598 a9 0a LDA #10 1131 159a 85 8e STA player0height 1132 159c .skip29then 1133 159c .skipL0121 1134 159c .L0122 ; return 1135 159c 1136 159c ba tsx 1137 159d b5 02 lda 2,x ; check return address 1138 159f 49 d5 eor #(>*) ; vs. current PCH 1139 15a1 29 e0 and #$E0 ; mask off all but top 3 bits 1140 15a3 f0 03 beq *+5 ; if equal, do normal return 1141 15a5 4c dd ff JMP BS_return 1142 15a8 60 RTS 1143 15a9 . 1144 15a9 ; 1145 15a9 1146 15a9 . 1147 15a9 ; 1148 15a9 1149 15a9 ._Control_Playfield_002_Colors 1150 15a9 ; _Control_Playfield_002_Colors 1151 15a9 1152 15a9 .L0123 ; COLUBK = $08 1153 15a9 1154 15a9 a9 08 LDA #$08 1155 15ab 85 09 STA COLUBK 1156 15ad .L0124 ; COLUPF = $99 1157 15ad 1158 15ad a9 99 LDA #$99 1159 15af 85 08 STA COLUPF 1160 15b1 .L0125 ; return 1161 15b1 1162 15b1 ba tsx 1163 15b2 b5 02 lda 2,x ; check return address 1164 15b4 49 d5 eor #(>*) ; vs. current PCH 1165 15b6 29 e0 and #$E0 ; mask off all but top 3 bits 1166 15b8 f0 03 beq *+5 ; if equal, do normal return 1167 15ba 4c dd ff JMP BS_return 1168 15bd 60 RTS 1169 15be . 1170 15be ; 1171 15be 1172 15be ._Control_Playfield_001_Setup 1173 15be ; _Control_Playfield_001_Setup 1174 15be 1175 15be .L0126 ; if playfield_design = 0 then playfield: 1176 15be 1177 15be a5 db LDA playfield_design 1178 15c0 c9 00 CMP #0 1179 15c2 d0 3e BNE .skipL0126 1180 15c4 .condpart31 1181 15c4 - ifconst pfres 1182 15c4 - ldx #(12>pfres)*(pfres*pfwidth-1)+(12<=pfres)*47 1183 15c4 else 1184 15c4 a2 2f ldx #((12*pfwidth-1)*((12*pfwidth-1)<47))+(47*((12*pfwidth-1)>=47)) 1185 15c6 endif 1186 15c6 4c f9 d5 jmp pflabel1 1187 15c9 PF_data1 1188 15c9 00 00 .byte.b %00000000, %00000000 1189 15cb if (pfwidth>2) 1190 15cb ff f0 .byte.b %11111111, %11110000 1191 15cd endif 1192 15cd 00 00 .byte.b %00000000, %00000000 1193 15cf if (pfwidth>2) 1194 15cf 00 00 .byte.b %00000000, %00000000 1195 15d1 endif 1196 15d1 00 00 .byte.b %00000000, %00000000 1197 15d3 if (pfwidth>2) 1198 15d3 00 00 .byte.b %00000000, %00000000 1199 15d5 endif 1200 15d5 7c 00 .byte.b %01111100, %00000000 1201 15d7 if (pfwidth>2) 1202 15d7 00 00 .byte.b %00000000, %00000000 1203 15d9 endif 1204 15d9 aa 00 .byte.b %10101010, %00000000 1205 15db if (pfwidth>2) 1206 15db 00 00 .byte.b %00000000, %00000000 1207 15dd endif 1208 15dd fe 00 .byte.b %11111110, %00000000 1209 15df if (pfwidth>2) 1210 15df 00 00 .byte.b %00000000, %00000000 1211 15e1 endif 1212 15e1 aa 00 .byte.b %10101010, %00000000 1213 15e3 if (pfwidth>2) 1214 15e3 00 00 .byte.b %00000000, %00000000 1215 15e5 endif 1216 15e5 aa 00 .byte.b %10101010, %00000000 1217 15e7 if (pfwidth>2) 1218 15e7 00 00 .byte.b %00000000, %00000000 1219 15e9 endif 1220 15e9 fe 00 .byte.b %11111110, %00000000 1221 15eb if (pfwidth>2) 1222 15eb 00 00 .byte.b %00000000, %00000000 1223 15ed endif 1224 15ed 00 00 .byte.b %00000000, %00000000 1225 15ef if (pfwidth>2) 1226 15ef 00 00 .byte.b %00000000, %00000000 1227 15f1 endif 1228 15f1 00 00 .byte.b %00000000, %00000000 1229 15f3 if (pfwidth>2) 1230 15f3 00 00 .byte.b %00000000, %00000000 1231 15f5 endif 1232 15f5 00 00 .byte.b %00000000, %00000000 1233 15f7 if (pfwidth>2) 1234 15f7 fc fc .byte.b %11111100, %11111100 1235 15f9 endif 1236 15f9 pflabel1 1237 15f9 bd c9 d5 lda PF_data1,x 1238 15fc 9d 50 10 sta playfield-128,x 1239 15ff ca dex 1240 1600 10 f7 bpl pflabel1 1241 1602 .skipL0126 1242 1602 .L0127 ; return 1243 1602 1244 1602 ba tsx 1245 1603 b5 02 lda 2,x ; check return address 1246 1605 49 d6 eor #(>*) ; vs. current PCH 1247 1607 29 e0 and #$E0 ; mask off all but top 3 bits 1248 1609 f0 03 beq *+5 ; if equal, do normal return 1249 160b 4c dd ff JMP BS_return 1250 160e 60 RTS 1251 160f . 1252 160f ; 1253 160f 1254 160f . 1255 160f ; 1256 160f 1257 160f ._Control_Scorebars_001_Setup 1258 160f ; _Control_Scorebars_001_Setup 1259 160f 1260 160f .L0128 ; pfscore1 = %10101010 : pfscore2 = %11111111 1261 160f 1262 160f a9 aa LDA #%10101010 1263 1611 85 f2 STA pfscore1 1264 1613 a9 ff LDA #%11111111 1265 1615 85 f3 STA pfscore2 1266 1617 .L0129 ; return 1267 1617 1268 1617 ba tsx 1269 1618 b5 02 lda 2,x ; check return address 1270 161a 49 d6 eor #(>*) ; vs. current PCH 1271 161c 29 e0 and #$E0 ; mask off all but top 3 bits 1272 161e f0 03 beq *+5 ; if equal, do normal return 1273 1620 4c dd ff JMP BS_return 1274 1623 60 RTS 1275 1624 . 1276 1624 ; 1277 1624 1278 1624 ._Control_Scorebars_002_Colors 1279 1624 ; _Control_Scorebars_002_Colors 1280 1624 1281 1624 .L0130 ; scorecolor = $14 1282 1624 1283 1624 a9 14 LDA #$14 1284 1626 85 a3 STA scorecolor 1285 1628 .L0131 ; pfscorecolor = $F2 1286 1628 1287 1628 a9 f2 LDA #$F2 1288 162a 85 f4 STA pfscorecolor 1289 162c .L0132 ; return 1290 162c 1291 162c ba tsx 1292 162d b5 02 lda 2,x ; check return address 1293 162f 49 d6 eor #(>*) ; vs. current PCH 1294 1631 29 e0 and #$E0 ; mask off all but top 3 bits 1295 1633 f0 03 beq *+5 ; if equal, do normal return 1296 1635 4c dd ff JMP BS_return 1297 1638 60 RTS 1298 1639 . 1299 1639 ; 1300 1639 1301 1639 . 1302 1639 ; 1303 1639 1304 1639 . 1305 1639 ; 1306 1639 1307 1639 . 1308 1639 ; 1309 1639 1310 1639 . 1311 1639 ; 1312 1639 1313 1639 ._Control_002_GAMESTATUS____________________________________ROUTINES 1314 1639 ; _Control_002_GAMESTATUS____________________________________ROUTINES 1315 1639 1316 1639 . 1317 1639 ; 1318 1639 1319 1639 ._level_image_loop 1320 1639 ; _level_image_loop 1321 1639 1322 1639 . 1323 1639 ; 1324 1639 1325 1639 .L0133 ; gosub _Control_Playfield_001_Setup 1326 1639 1327 1639 20 be d5 jsr ._Control_Playfield_001_Setup 1328 163c 1329 163c .L0134 ; gosub _Control_Playfield_002_Colors 1330 163c 1331 163c 20 a9 d5 jsr ._Control_Playfield_002_Colors 1332 163f 1333 163f .L0135 ; gosub _Control_Scorebars_002_Colors 1334 163f 1335 163f 20 24 d6 jsr ._Control_Scorebars_002_Colors 1336 1642 1337 1642 . 1338 1642 ; 1339 1642 1340 1642 .L0136 ; level_value = 15 1341 1642 1342 1642 a9 0f LDA #15 1343 1644 85 d6 STA level_value 1344 1646 . 1345 1646 ; 1346 1646 1347 1646 .L0137 ; if level_value < 10 then player1x = 70 1348 1646 1349 1646 a5 d6 LDA level_value 1350 1648 c9 0a CMP #10 1351 164a b0 04 BCS .skipL0137 1352 164c .condpart32 1353 164c a9 46 LDA #70 1354 164e 85 81 STA player1x 1355 1650 .skipL0137 1356 1650 .L0138 ; if level_value > 10 then player1x = 65 1357 1650 1358 1650 a9 0a LDA #10 1359 1652 c5 d6 CMP level_value 1360 1654 b0 04 BCS .skipL0138 1361 1656 .condpart33 1362 1656 a9 41 LDA #65 1363 1658 85 81 STA player1x 1364 165a .skipL0138 1365 165a . 1366 165a ; 1367 165a 1368 165a .L0139 ; player0x = 70 1369 165a 1370 165a a9 46 LDA #70 1371 165c 85 80 STA player0x 1372 165e .L0140 ; player0y = 80 1373 165e 1374 165e a9 50 LDA #80 1375 1660 85 85 STA player0y 1376 1662 .L0141 ; player1y = 35 1377 1662 1378 1662 a9 23 LDA #35 1379 1664 85 86 STA player1y 1380 1666 . 1381 1666 ; 1382 1666 1383 1666 .L0142 ; COLUP0 = $44 1384 1666 1385 1666 a9 44 LDA #$44 1386 1668 85 06 STA COLUP0 1387 166a .L0143 ; COLUP1 = $99 1388 166a 1389 166a a9 99 LDA #$99 1390 166c 85 07 STA COLUP1 1391 166e .L0144 ; COLUBK = $08 1392 166e 1393 166e a9 08 LDA #$08 1394 1670 85 09 STA COLUBK 1395 1672 .L0145 ; COLUPF = $D4 1396 1672 1397 1672 a9 d4 LDA #$D4 1398 1674 85 08 STA COLUPF 1399 1676 . 1400 1676 ; 1401 1676 1402 1676 .L0146 ; rem NUSIZ0 = $05 1403 1676 1404 1676 .L0147 ; rem NUSIZ1 = $05 1405 1676 1406 1676 . 1407 1676 ; 1408 1676 1409 1676 .L0148 ; player0: 1410 1676 1411 1676 a2 60 LDX #playerL0148_0 1414 167c 85 8b STA player0pointerhi 1415 167e a9 07 LDA #7 1416 1680 85 8e STA player0height 1417 1682 .L0149 ; if level_value = 0 then player1: 1418 1682 1419 1682 a5 d6 LDA level_value 1420 1684 c9 00 CMP #0 1421 1686 d0 0c BNE .skipL0149 1422 1688 .condpart34 1423 1688 a2 68 LDX #player34then_1 1426 168e 85 8d STA player1pointerhi 1427 1690 a9 05 LDA #5 1428 1692 85 8f STA player1height 1429 1694 .skipL0149 1430 1694 .L0150 ; if level_value = 1 then player1: 1431 1694 1432 1694 a5 d6 LDA level_value 1433 1696 c9 01 CMP #1 1434 1698 d0 0c BNE .skipL0150 1435 169a .condpart35 1436 169a a2 6e LDX #player35then_1 1439 16a0 85 8d STA player1pointerhi 1440 16a2 a9 05 LDA #5 1441 16a4 85 8f STA player1height 1442 16a6 .skipL0150 1443 16a6 .L0151 ; if level_value = 2 then player1: 1444 16a6 1445 16a6 a5 d6 LDA level_value 1446 16a8 c9 02 CMP #2 1447 16aa d0 0c BNE .skipL0151 1448 16ac .condpart36 1449 16ac a2 74 LDX #player36then_1 1452 16b2 85 8d STA player1pointerhi 1453 16b4 a9 05 LDA #5 1454 16b6 85 8f STA player1height 1455 16b8 .skipL0151 1456 16b8 .L0152 ; if level_value = 3 then player1: 1457 16b8 1458 16b8 a5 d6 LDA level_value 1459 16ba c9 03 CMP #3 1460 16bc d0 0c BNE .skipL0152 1461 16be .condpart37 1462 16be a2 7a LDX #player37then_1 1465 16c4 85 8d STA player1pointerhi 1466 16c6 a9 05 LDA #5 1467 16c8 85 8f STA player1height 1468 16ca .skipL0152 1469 16ca .L0153 ; if level_value = 4 then player1: 1470 16ca 1471 16ca a5 d6 LDA level_value 1472 16cc c9 04 CMP #4 1473 16ce d0 0c BNE .skipL0153 1474 16d0 .condpart38 1475 16d0 a2 80 LDX #player38then_1 1478 16d6 85 8d STA player1pointerhi 1479 16d8 a9 05 LDA #5 1480 16da 85 8f STA player1height 1481 16dc .skipL0153 1482 16dc .L0154 ; if level_value = 5 then player1: 1483 16dc 1484 16dc a5 d6 LDA level_value 1485 16de c9 05 CMP #5 1486 16e0 d0 0c BNE .skipL0154 1487 16e2 .condpart39 1488 16e2 a2 86 LDX #player39then_1 1491 16e8 85 8d STA player1pointerhi 1492 16ea a9 05 LDA #5 1493 16ec 85 8f STA player1height 1494 16ee .skipL0154 1495 16ee .L0155 ; if level_value = 6 then player1: 1496 16ee 1497 16ee a5 d6 LDA level_value 1498 16f0 c9 06 CMP #6 1499 16f2 d0 0c BNE .skipL0155 1500 16f4 .condpart40 1501 16f4 a2 8c LDX #player40then_1 1504 16fa 85 8d STA player1pointerhi 1505 16fc a9 05 LDA #5 1506 16fe 85 8f STA player1height 1507 1700 .skipL0155 1508 1700 .L0156 ; if level_value = 7 then player1: 1509 1700 1510 1700 a5 d6 LDA level_value 1511 1702 c9 07 CMP #7 1512 1704 d0 0c BNE .skipL0156 1513 1706 .condpart41 1514 1706 a2 92 LDX #player41then_1 1517 170c 85 8d STA player1pointerhi 1518 170e a9 05 LDA #5 1519 1710 85 8f STA player1height 1520 1712 .skipL0156 1521 1712 .L0157 ; if level_value = 8 then player1: 1522 1712 1523 1712 a5 d6 LDA level_value 1524 1714 c9 08 CMP #8 1525 1716 d0 0c BNE .skipL0157 1526 1718 .condpart42 1527 1718 a2 98 LDX #player42then_1 1530 171e 85 8d STA player1pointerhi 1531 1720 a9 05 LDA #5 1532 1722 85 8f STA player1height 1533 1724 .skipL0157 1534 1724 .L0158 ; if level_value = 9 then player1: 1535 1724 1536 1724 a5 d6 LDA level_value 1537 1726 c9 09 CMP #9 1538 1728 d0 0c BNE .skipL0158 1539 172a .condpart43 1540 172a a2 9e LDX #player43then_1 1543 1730 85 8d STA player1pointerhi 1544 1732 a9 05 LDA #5 1545 1734 85 8f STA player1height 1546 1736 .skipL0158 1547 1736 .L0159 ; if level_value = 10 then player1: 1548 1736 1549 1736 a5 d6 LDA level_value 1550 1738 c9 0a CMP #10 1551 173a d0 0c BNE .skipL0159 1552 173c .condpart44 1553 173c a2 a4 LDX #player44then_1 1556 1742 85 8d STA player1pointerhi 1557 1744 a9 05 LDA #5 1558 1746 85 8f STA player1height 1559 1748 .skipL0159 1560 1748 .L0160 ; if level_value = 11 then player1: 1561 1748 1562 1748 a5 d6 LDA level_value 1563 174a c9 0b CMP #11 1564 174c d0 0c BNE .skipL0160 1565 174e .condpart45 1566 174e a2 aa LDX #player45then_1 1569 1754 85 8d STA player1pointerhi 1570 1756 a9 05 LDA #5 1571 1758 85 8f STA player1height 1572 175a .skipL0160 1573 175a .L0161 ; if level_value = 12 then player1: 1574 175a 1575 175a a5 d6 LDA level_value 1576 175c c9 0c CMP #12 1577 175e d0 0c BNE .skipL0161 1578 1760 .condpart46 1579 1760 a2 b0 LDX #player46then_1 1582 1766 85 8d STA player1pointerhi 1583 1768 a9 05 LDA #5 1584 176a 85 8f STA player1height 1585 176c .skipL0161 1586 176c .L0162 ; if level_value = 13 then player1: 1587 176c 1588 176c a5 d6 LDA level_value 1589 176e c9 0d CMP #13 1590 1770 d0 0c BNE .skipL0162 1591 1772 .condpart47 1592 1772 a2 b6 LDX #player47then_1 1595 1778 85 8d STA player1pointerhi 1596 177a a9 05 LDA #5 1597 177c 85 8f STA player1height 1598 177e .skipL0162 1599 177e .L0163 ; if level_value = 14 then player1: 1600 177e 1601 177e a5 d6 LDA level_value 1602 1780 c9 0e CMP #14 1603 1782 d0 0c BNE .skipL0163 1604 1784 .condpart48 1605 1784 a2 bc LDX #player48then_1 1608 178a 85 8d STA player1pointerhi 1609 178c a9 05 LDA #5 1610 178e 85 8f STA player1height 1611 1790 .skipL0163 1612 1790 .L0164 ; if level_value = 15 then player1: 1613 1790 1614 1790 a5 d6 LDA level_value 1615 1792 c9 0f CMP #15 1616 1794 d0 0c BNE .skipL0164 1617 1796 .condpart49 1618 1796 a2 c2 LDX #player49then_1 1621 179c 85 8d STA player1pointerhi 1622 179e a9 05 LDA #5 1623 17a0 85 8f STA player1height 1624 17a2 .skipL0164 1625 17a2 .L0165 ; if level_value = 16 then player1: 1626 17a2 1627 17a2 a5 d6 LDA level_value 1628 17a4 c9 10 CMP #16 1629 17a6 d0 0c BNE .skipL0165 1630 17a8 .condpart50 1631 17a8 a2 c8 LDX #player50then_1 1634 17ae 85 8d STA player1pointerhi 1635 17b0 a9 05 LDA #5 1636 17b2 85 8f STA player1height 1637 17b4 .skipL0165 1638 17b4 .L0166 ; if level_value = 17 then player1: 1639 17b4 1640 17b4 a5 d6 LDA level_value 1641 17b6 c9 11 CMP #17 1642 17b8 d0 0c BNE .skipL0166 1643 17ba .condpart51 1644 17ba a2 ce LDX #player51then_1 1647 17c0 85 8d STA player1pointerhi 1648 17c2 a9 05 LDA #5 1649 17c4 85 8f STA player1height 1650 17c6 .skipL0166 1651 17c6 .L0167 ; if level_value = 18 then player1: 1652 17c6 1653 17c6 a5 d6 LDA level_value 1654 17c8 c9 12 CMP #18 1655 17ca d0 0c BNE .skipL0167 1656 17cc .condpart52 1657 17cc a2 d4 LDX #player52then_1 1660 17d2 85 8d STA player1pointerhi 1661 17d4 a9 05 LDA #5 1662 17d6 85 8f STA player1height 1663 17d8 .skipL0167 1664 17d8 .L0168 ; if level_value = 19 then player1: 1665 17d8 1666 17d8 a5 d6 LDA level_value 1667 17da c9 13 CMP #19 1668 17dc d0 0c BNE .skipL0168 1669 17de .condpart53 1670 17de a2 da LDX #player53then_1 1673 17e4 85 8d STA player1pointerhi 1674 17e6 a9 05 LDA #5 1675 17e8 85 8f STA player1height 1676 17ea .skipL0168 1677 17ea .L0169 ; if level_value = 20 then player1: 1678 17ea 1679 17ea a5 d6 LDA level_value 1680 17ec c9 14 CMP #20 1681 17ee d0 0c BNE .skipL0169 1682 17f0 .condpart54 1683 17f0 a2 e0 LDX #player54then_1 1686 17f6 85 8d STA player1pointerhi 1687 17f8 a9 05 LDA #5 1688 17fa 85 8f STA player1height 1689 17fc .skipL0169 1690 17fc .L0170 ; if level_value = 21 then player1: 1691 17fc 1692 17fc a5 d6 LDA level_value 1693 17fe c9 15 CMP #21 1694 1800 d0 0c BNE .skipL0170 1695 1802 .condpart55 1696 1802 a2 e6 LDX #player55then_1 1699 1808 85 8d STA player1pointerhi 1700 180a a9 05 LDA #5 1701 180c 85 8f STA player1height 1702 180e .skipL0170 1703 180e .L0171 ; if level_value = 22 then player1: 1704 180e 1705 180e a5 d6 LDA level_value 1706 1810 c9 16 CMP #22 1707 1812 d0 0c BNE .skipL0171 1708 1814 .condpart56 1709 1814 a2 ec LDX #player56then_1 1712 181a 85 8d STA player1pointerhi 1713 181c a9 05 LDA #5 1714 181e 85 8f STA player1height 1715 1820 .skipL0171 1716 1820 .L0172 ; if level_value = 23 then player1: 1717 1820 1718 1820 a5 d6 LDA level_value 1719 1822 c9 17 CMP #23 1720 1824 d0 0c BNE .skipL0172 1721 1826 .condpart57 1722 1826 a2 f2 LDX #player57then_1 1725 182c 85 8d STA player1pointerhi 1726 182e a9 05 LDA #5 1727 1830 85 8f STA player1height 1728 1832 .skipL0172 1729 1832 .L0173 ; if level_value = 24 then player1: 1730 1832 1731 1832 a5 d6 LDA level_value 1732 1834 c9 18 CMP #24 1733 1836 d0 0c BNE .skipL0173 1734 1838 .condpart58 1735 1838 a2 f8 LDX #player58then_1 1738 183e 85 8d STA player1pointerhi 1739 1840 a9 05 LDA #5 1740 1842 85 8f STA player1height 1741 1844 .skipL0173 1742 1844 .L0174 ; if level_value = 25 then player1: 1743 1844 1744 1844 a5 d6 LDA level_value 1745 1846 c9 19 CMP #25 1746 1848 d0 0c BNE .skipL0174 1747 184a .condpart59 1748 184a a2 00 LDX #player59then_1 1751 1850 85 8d STA player1pointerhi 1752 1852 a9 05 LDA #5 1753 1854 85 8f STA player1height 1754 1856 .skipL0174 1755 1856 .L0175 ; if level_value = 26 then player1: 1756 1856 1757 1856 a5 d6 LDA level_value 1758 1858 c9 1a CMP #26 1759 185a d0 0c BNE .skipL0175 1760 185c .condpart60 1761 185c a2 06 LDX #player60then_1 1764 1862 85 8d STA player1pointerhi 1765 1864 a9 04 LDA #4 1766 1866 85 8f STA player1height 1767 1868 .skipL0175 1768 1868 .L0176 ; if level_value = 27 then player1: 1769 1868 1770 1868 a5 d6 LDA level_value 1771 186a c9 1b CMP #27 1772 186c d0 0c BNE .skipL0176 1773 186e .condpart61 1774 186e a2 0b LDX #player61then_1 1777 1874 85 8d STA player1pointerhi 1778 1876 a9 05 LDA #5 1779 1878 85 8f STA player1height 1780 187a .skipL0176 1781 187a .L0177 ; if level_value = 28 then player1: 1782 187a 1783 187a a5 d6 LDA level_value 1784 187c c9 1c CMP #28 1785 187e d0 0c BNE .skipL0177 1786 1880 .condpart62 1787 1880 a2 11 LDX #player62then_1 1790 1886 85 8d STA player1pointerhi 1791 1888 a9 05 LDA #5 1792 188a 85 8f STA player1height 1793 188c .skipL0177 1794 188c .L0178 ; if level_value = 29 then player1: 1795 188c 1796 188c a5 d6 LDA level_value 1797 188e c9 1d CMP #29 1798 1890 d0 0c BNE .skipL0178 1799 1892 .condpart63 1800 1892 a2 17 LDX #player63then_1 1803 1898 85 8d STA player1pointerhi 1804 189a a9 05 LDA #5 1805 189c 85 8f STA player1height 1806 189e .skipL0178 1807 189e .L0179 ; if level_value = 30 then player1: 1808 189e 1809 189e a5 d6 LDA level_value 1810 18a0 c9 1e CMP #30 1811 18a2 d0 0c BNE .skipL0179 1812 18a4 .condpart64 1813 18a4 a2 1d LDX #player64then_1 1816 18aa 85 8d STA player1pointerhi 1817 18ac a9 05 LDA #5 1818 18ae 85 8f STA player1height 1819 18b0 .skipL0179 1820 18b0 .L0180 ; if level_value = 31 then player1: 1821 18b0 1822 18b0 a5 d6 LDA level_value 1823 18b2 c9 1f CMP #31 1824 18b4 d0 0c BNE .skipL0180 1825 18b6 .condpart65 1826 18b6 a2 23 LDX #player65then_1 1829 18bc 85 8d STA player1pointerhi 1830 18be a9 04 LDA #4 1831 18c0 85 8f STA player1height 1832 18c2 .skipL0180 1833 18c2 . 1834 18c2 ; 1835 18c2 1836 18c2 .L0181 ; if joy0fire then return 1837 18c2 1838 18c2 24 0c bit INPT4 1839 18c4 30 0d BMI .skipL0181 1840 18c6 .condpart66 1841 18c6 ba tsx 1842 18c7 b5 02 lda 2,x ; check return address 1843 18c9 49 d8 eor #(>*) ; vs. current PCH 1844 18cb 29 e0 and #$E0 ; mask off all but top 3 bits 1845 18cd f0 03 beq *+5 ; if equal, do normal return 1846 18cf 4c dd ff JMP BS_return 1847 18d2 60 RTS 1848 18d3 .skipL0181 1849 18d3 .L0182 ; drawscreen 1850 18d3 1851 18d3 85 d4 sta temp7 1852 18d5 a9 d8 lda #>(ret_point7-1) 1853 18d7 48 pha 1854 18d8 a9 ea lda #<(ret_point7-1) 1855 18da 48 pha 1856 18db a9 f5 lda #>(drawscreen-1) 1857 18dd 48 pha 1858 18de a9 82 lda #<(drawscreen-1) 1859 18e0 48 pha 1860 18e1 a5 d4 lda temp7 1861 18e3 48 pha 1862 18e4 8a txa 1863 18e5 48 pha 1864 18e6 a2 02 ldx #2 1865 18e8 4c eb ff jmp BS_jsr 1866 18eb ret_point7 1867 18eb . 1868 18eb ; 1869 18eb 1870 18eb .L0183 ; goto _level_image_loop 1871 18eb 4c 39 d6 jmp ._level_image_loop 1872 18ee if ECHO1 1766 bytes of ROM space left in bank 1 1873 18ee echo " ",[(start_bank1 - *)]d , "bytes of ROM space left in bank 1") 1874 18ee endif 1875 18ee 00 01 ECHO1 = 1 1876 1fd4 ORG $1FF4-bscode_length 1877 1fd4 RORG $DFF4-bscode_length 1878 1fd4 a2 ff start_bank1 ldx #$ff 1879 1fd6 - ifconst FASTFETCH ; using DPC+ 1880 1fd6 - stx FASTFETCH 1881 1fd6 endif 1882 1fd6 9a txs 1883 1fd7 - if bankswitch == 64 1884 1fd7 - lda #(((>(start-1)) & $0F) | $F0) 1885 1fd7 else 1886 1fd7 a9 f3 lda #>(start-1) 1887 1fd9 endif 1888 1fd9 48 pha 1889 1fda a9 51 lda #<(start-1) 1890 1fdc 48 pha 1891 1fdd 48 pha 1892 1fde 8a txa 1893 1fdf 48 pha 1894 1fe0 ba tsx 1895 1fe1 if bankswitch != 64 1896 1fe1 b5 04 lda 4,x ; get high byte of return address 1897 1fe3 2a rol 1898 1fe4 2a rol 1899 1fe5 2a rol 1900 1fe6 2a rol 1901 1fe7 29 01 and #bs_mask ;1 3 or 7 for F8/F6/F4 1902 1fe9 aa tax 1903 1fea e8 inx 1904 1feb - else 1905 1feb - lda 4,x ; get high byte of return address 1906 1feb - tay 1907 1feb - ora #$10 ; change our bank nibble into a valid rom mirror 1908 1feb - sta 4,x 1909 1feb - tya 1910 1feb - lsr 1911 1feb - lsr 1912 1feb - lsr 1913 1feb - lsr 1914 1feb - tax 1915 1feb - inx 1916 1feb endif 1917 1feb bd f7 1f lda bankswitch_hotspot-1,x 1918 1fee 68 pla 1919 1fef aa tax 1920 1ff0 68 pla 1921 1ff1 60 rts 1922 1ff2 - if ((* & $1FFF) > ((bankswitch_hotspot & $1FFF) - 1)) 1923 1ff2 - echo "WARNING: size parameter in banksw.asm too small - the program probably will not work." 1924 1ff2 - echo "Change to",[(*-begin_bscode+1)&$FF]d,"and try again." 1925 1ff2 endif 1926 1ffc ORG $1FFC 1927 1ffc RORG $DFFC 1928 1ffc d4 df .word.w start_bank1 1929 1ffe d4 df .word.w start_bank1 1930 2000 ORG $2000 1931 2000 RORG $F000 1932 2000 repeat 256 1933 2000 ff .byte.b $ff 1932 2000 repend 1933 2001 ff .byte.b $ff 1932 2001 repend 1933 2002 ff .byte.b $ff 1932 2002 repend 1933 2003 ff .byte.b $ff 1932 2003 repend 1933 2004 ff .byte.b $ff 1932 2004 repend 1933 2005 ff .byte.b $ff 1932 2005 repend 1933 2006 ff .byte.b $ff 1932 2006 repend 1933 2007 ff .byte.b $ff 1932 2007 repend 1933 2008 ff .byte.b $ff 1932 2008 repend 1933 2009 ff .byte.b $ff 1932 2009 repend 1933 200a ff .byte.b $ff 1932 200a repend 1933 200b ff .byte.b $ff 1932 200b repend 1933 200c ff .byte.b $ff 1932 200c repend 1933 200d ff .byte.b $ff 1932 200d repend 1933 200e ff .byte.b $ff 1932 200e repend 1933 200f ff .byte.b $ff 1932 200f repend 1933 2010 ff .byte.b $ff 1932 2010 repend 1933 2011 ff .byte.b $ff 1932 2011 repend 1933 2012 ff .byte.b $ff 1932 2012 repend 1933 2013 ff .byte.b $ff 1932 2013 repend 1933 2014 ff .byte.b $ff 1932 2014 repend 1933 2015 ff .byte.b $ff 1932 2015 repend 1933 2016 ff .byte.b $ff 1932 2016 repend 1933 2017 ff .byte.b $ff 1932 2017 repend 1933 2018 ff .byte.b $ff 1932 2018 repend 1933 2019 ff .byte.b $ff 1932 2019 repend 1933 201a ff .byte.b $ff 1932 201a repend 1933 201b ff .byte.b $ff 1932 201b repend 1933 201c ff .byte.b $ff 1932 201c repend 1933 201d ff .byte.b $ff 1932 201d repend 1933 201e ff .byte.b $ff 1932 201e repend 1933 201f ff .byte.b $ff 1932 201f repend 1933 2020 ff .byte.b $ff 1932 2020 repend 1933 2021 ff .byte.b $ff 1932 2021 repend 1933 2022 ff .byte.b $ff 1932 2022 repend 1933 2023 ff .byte.b $ff 1932 2023 repend 1933 2024 ff .byte.b $ff 1932 2024 repend 1933 2025 ff .byte.b $ff 1932 2025 repend 1933 2026 ff .byte.b $ff 1932 2026 repend 1933 2027 ff .byte.b $ff 1932 2027 repend 1933 2028 ff .byte.b $ff 1932 2028 repend 1933 2029 ff .byte.b $ff 1932 2029 repend 1933 202a ff .byte.b $ff 1932 202a repend 1933 202b ff .byte.b $ff 1932 202b repend 1933 202c ff .byte.b $ff 1932 202c repend 1933 202d ff .byte.b $ff 1932 202d repend 1933 202e ff .byte.b $ff 1932 202e repend 1933 202f ff .byte.b $ff 1932 202f repend 1933 2030 ff .byte.b $ff 1932 2030 repend 1933 2031 ff .byte.b $ff 1932 2031 repend 1933 2032 ff .byte.b $ff 1932 2032 repend 1933 2033 ff .byte.b $ff 1932 2033 repend 1933 2034 ff .byte.b $ff 1932 2034 repend 1933 2035 ff .byte.b $ff 1932 2035 repend 1933 2036 ff .byte.b $ff 1932 2036 repend 1933 2037 ff .byte.b $ff 1932 2037 repend 1933 2038 ff .byte.b $ff 1932 2038 repend 1933 2039 ff .byte.b $ff 1932 2039 repend 1933 203a ff .byte.b $ff 1932 203a repend 1933 203b ff .byte.b $ff 1932 203b repend 1933 203c ff .byte.b $ff 1932 203c repend 1933 203d ff .byte.b $ff 1932 203d repend 1933 203e ff .byte.b $ff 1932 203e repend 1933 203f ff .byte.b $ff 1932 203f repend 1933 2040 ff .byte.b $ff 1932 2040 repend 1933 2041 ff .byte.b $ff 1932 2041 repend 1933 2042 ff .byte.b $ff 1932 2042 repend 1933 2043 ff .byte.b $ff 1932 2043 repend 1933 2044 ff .byte.b $ff 1932 2044 repend 1933 2045 ff .byte.b $ff 1932 2045 repend 1933 2046 ff .byte.b $ff 1932 2046 repend 1933 2047 ff .byte.b $ff 1932 2047 repend 1933 2048 ff .byte.b $ff 1932 2048 repend 1933 2049 ff .byte.b $ff 1932 2049 repend 1933 204a ff .byte.b $ff 1932 204a repend 1933 204b ff .byte.b $ff 1932 204b repend 1933 204c ff .byte.b $ff 1932 204c repend 1933 204d ff .byte.b $ff 1932 204d repend 1933 204e ff .byte.b $ff 1932 204e repend 1933 204f ff .byte.b $ff 1932 204f repend 1933 2050 ff .byte.b $ff 1932 2050 repend 1933 2051 ff .byte.b $ff 1932 2051 repend 1933 2052 ff .byte.b $ff 1932 2052 repend 1933 2053 ff .byte.b $ff 1932 2053 repend 1933 2054 ff .byte.b $ff 1932 2054 repend 1933 2055 ff .byte.b $ff 1932 2055 repend 1933 2056 ff .byte.b $ff 1932 2056 repend 1933 2057 ff .byte.b $ff 1932 2057 repend 1933 2058 ff .byte.b $ff 1932 2058 repend 1933 2059 ff .byte.b $ff 1932 2059 repend 1933 205a ff .byte.b $ff 1932 205a repend 1933 205b ff .byte.b $ff 1932 205b repend 1933 205c ff .byte.b $ff 1932 205c repend 1933 205d ff .byte.b $ff 1932 205d repend 1933 205e ff .byte.b $ff 1932 205e repend 1933 205f ff .byte.b $ff 1932 205f repend 1933 2060 ff .byte.b $ff 1932 2060 repend 1933 2061 ff .byte.b $ff 1932 2061 repend 1933 2062 ff .byte.b $ff 1932 2062 repend 1933 2063 ff .byte.b $ff 1932 2063 repend 1933 2064 ff .byte.b $ff 1932 2064 repend 1933 2065 ff .byte.b $ff 1932 2065 repend 1933 2066 ff .byte.b $ff 1932 2066 repend 1933 2067 ff .byte.b $ff 1932 2067 repend 1933 2068 ff .byte.b $ff 1932 2068 repend 1933 2069 ff .byte.b $ff 1932 2069 repend 1933 206a ff .byte.b $ff 1932 206a repend 1933 206b ff .byte.b $ff 1932 206b repend 1933 206c ff .byte.b $ff 1932 206c repend 1933 206d ff .byte.b $ff 1932 206d repend 1933 206e ff .byte.b $ff 1932 206e repend 1933 206f ff .byte.b $ff 1932 206f repend 1933 2070 ff .byte.b $ff 1932 2070 repend 1933 2071 ff .byte.b $ff 1932 2071 repend 1933 2072 ff .byte.b $ff 1932 2072 repend 1933 2073 ff .byte.b $ff 1932 2073 repend 1933 2074 ff .byte.b $ff 1932 2074 repend 1933 2075 ff .byte.b $ff 1932 2075 repend 1933 2076 ff .byte.b $ff 1932 2076 repend 1933 2077 ff .byte.b $ff 1932 2077 repend 1933 2078 ff .byte.b $ff 1932 2078 repend 1933 2079 ff .byte.b $ff 1932 2079 repend 1933 207a ff .byte.b $ff 1932 207a repend 1933 207b ff .byte.b $ff 1932 207b repend 1933 207c ff .byte.b $ff 1932 207c repend 1933 207d ff .byte.b $ff 1932 207d repend 1933 207e ff .byte.b $ff 1932 207e repend 1933 207f ff .byte.b $ff 1932 207f repend 1933 2080 ff .byte.b $ff 1932 2080 repend 1933 2081 ff .byte.b $ff 1932 2081 repend 1933 2082 ff .byte.b $ff 1932 2082 repend 1933 2083 ff .byte.b $ff 1932 2083 repend 1933 2084 ff .byte.b $ff 1932 2084 repend 1933 2085 ff .byte.b $ff 1932 2085 repend 1933 2086 ff .byte.b $ff 1932 2086 repend 1933 2087 ff .byte.b $ff 1932 2087 repend 1933 2088 ff .byte.b $ff 1932 2088 repend 1933 2089 ff .byte.b $ff 1932 2089 repend 1933 208a ff .byte.b $ff 1932 208a repend 1933 208b ff .byte.b $ff 1932 208b repend 1933 208c ff .byte.b $ff 1932 208c repend 1933 208d ff .byte.b $ff 1932 208d repend 1933 208e ff .byte.b $ff 1932 208e repend 1933 208f ff .byte.b $ff 1932 208f repend 1933 2090 ff .byte.b $ff 1932 2090 repend 1933 2091 ff .byte.b $ff 1932 2091 repend 1933 2092 ff .byte.b $ff 1932 2092 repend 1933 2093 ff .byte.b $ff 1932 2093 repend 1933 2094 ff .byte.b $ff 1932 2094 repend 1933 2095 ff .byte.b $ff 1932 2095 repend 1933 2096 ff .byte.b $ff 1932 2096 repend 1933 2097 ff .byte.b $ff 1932 2097 repend 1933 2098 ff .byte.b $ff 1932 2098 repend 1933 2099 ff .byte.b $ff 1932 2099 repend 1933 209a ff .byte.b $ff 1932 209a repend 1933 209b ff .byte.b $ff 1932 209b repend 1933 209c ff .byte.b $ff 1932 209c repend 1933 209d ff .byte.b $ff 1932 209d repend 1933 209e ff .byte.b $ff 1932 209e repend 1933 209f ff .byte.b $ff 1932 209f repend 1933 20a0 ff .byte.b $ff 1932 20a0 repend 1933 20a1 ff .byte.b $ff 1932 20a1 repend 1933 20a2 ff .byte.b $ff 1932 20a2 repend 1933 20a3 ff .byte.b $ff 1932 20a3 repend 1933 20a4 ff .byte.b $ff 1932 20a4 repend 1933 20a5 ff .byte.b $ff 1932 20a5 repend 1933 20a6 ff .byte.b $ff 1932 20a6 repend 1933 20a7 ff .byte.b $ff 1932 20a7 repend 1933 20a8 ff .byte.b $ff 1932 20a8 repend 1933 20a9 ff .byte.b $ff 1932 20a9 repend 1933 20aa ff .byte.b $ff 1932 20aa repend 1933 20ab ff .byte.b $ff 1932 20ab repend 1933 20ac ff .byte.b $ff 1932 20ac repend 1933 20ad ff .byte.b $ff 1932 20ad repend 1933 20ae ff .byte.b $ff 1932 20ae repend 1933 20af ff .byte.b $ff 1932 20af repend 1933 20b0 ff .byte.b $ff 1932 20b0 repend 1933 20b1 ff .byte.b $ff 1932 20b1 repend 1933 20b2 ff .byte.b $ff 1932 20b2 repend 1933 20b3 ff .byte.b $ff 1932 20b3 repend 1933 20b4 ff .byte.b $ff 1932 20b4 repend 1933 20b5 ff .byte.b $ff 1932 20b5 repend 1933 20b6 ff .byte.b $ff 1932 20b6 repend 1933 20b7 ff .byte.b $ff 1932 20b7 repend 1933 20b8 ff .byte.b $ff 1932 20b8 repend 1933 20b9 ff .byte.b $ff 1932 20b9 repend 1933 20ba ff .byte.b $ff 1932 20ba repend 1933 20bb ff .byte.b $ff 1932 20bb repend 1933 20bc ff .byte.b $ff 1932 20bc repend 1933 20bd ff .byte.b $ff 1932 20bd repend 1933 20be ff .byte.b $ff 1932 20be repend 1933 20bf ff .byte.b $ff 1932 20bf repend 1933 20c0 ff .byte.b $ff 1932 20c0 repend 1933 20c1 ff .byte.b $ff 1932 20c1 repend 1933 20c2 ff .byte.b $ff 1932 20c2 repend 1933 20c3 ff .byte.b $ff 1932 20c3 repend 1933 20c4 ff .byte.b $ff 1932 20c4 repend 1933 20c5 ff .byte.b $ff 1932 20c5 repend 1933 20c6 ff .byte.b $ff 1932 20c6 repend 1933 20c7 ff .byte.b $ff 1932 20c7 repend 1933 20c8 ff .byte.b $ff 1932 20c8 repend 1933 20c9 ff .byte.b $ff 1932 20c9 repend 1933 20ca ff .byte.b $ff 1932 20ca repend 1933 20cb ff .byte.b $ff 1932 20cb repend 1933 20cc ff .byte.b $ff 1932 20cc repend 1933 20cd ff .byte.b $ff 1932 20cd repend 1933 20ce ff .byte.b $ff 1932 20ce repend 1933 20cf ff .byte.b $ff 1932 20cf repend 1933 20d0 ff .byte.b $ff 1932 20d0 repend 1933 20d1 ff .byte.b $ff 1932 20d1 repend 1933 20d2 ff .byte.b $ff 1932 20d2 repend 1933 20d3 ff .byte.b $ff 1932 20d3 repend 1933 20d4 ff .byte.b $ff 1932 20d4 repend 1933 20d5 ff .byte.b $ff 1932 20d5 repend 1933 20d6 ff .byte.b $ff 1932 20d6 repend 1933 20d7 ff .byte.b $ff 1932 20d7 repend 1933 20d8 ff .byte.b $ff 1932 20d8 repend 1933 20d9 ff .byte.b $ff 1932 20d9 repend 1933 20da ff .byte.b $ff 1932 20da repend 1933 20db ff .byte.b $ff 1932 20db repend 1933 20dc ff .byte.b $ff 1932 20dc repend 1933 20dd ff .byte.b $ff 1932 20dd repend 1933 20de ff .byte.b $ff 1932 20de repend 1933 20df ff .byte.b $ff 1932 20df repend 1933 20e0 ff .byte.b $ff 1932 20e0 repend 1933 20e1 ff .byte.b $ff 1932 20e1 repend 1933 20e2 ff .byte.b $ff 1932 20e2 repend 1933 20e3 ff .byte.b $ff 1932 20e3 repend 1933 20e4 ff .byte.b $ff 1932 20e4 repend 1933 20e5 ff .byte.b $ff 1932 20e5 repend 1933 20e6 ff .byte.b $ff 1932 20e6 repend 1933 20e7 ff .byte.b $ff 1932 20e7 repend 1933 20e8 ff .byte.b $ff 1932 20e8 repend 1933 20e9 ff .byte.b $ff 1932 20e9 repend 1933 20ea ff .byte.b $ff 1932 20ea repend 1933 20eb ff .byte.b $ff 1932 20eb repend 1933 20ec ff .byte.b $ff 1932 20ec repend 1933 20ed ff .byte.b $ff 1932 20ed repend 1933 20ee ff .byte.b $ff 1932 20ee repend 1933 20ef ff .byte.b $ff 1932 20ef repend 1933 20f0 ff .byte.b $ff 1932 20f0 repend 1933 20f1 ff .byte.b $ff 1932 20f1 repend 1933 20f2 ff .byte.b $ff 1932 20f2 repend 1933 20f3 ff .byte.b $ff 1932 20f3 repend 1933 20f4 ff .byte.b $ff 1932 20f4 repend 1933 20f5 ff .byte.b $ff 1932 20f5 repend 1933 20f6 ff .byte.b $ff 1932 20f6 repend 1933 20f7 ff .byte.b $ff 1932 20f7 repend 1933 20f8 ff .byte.b $ff 1932 20f8 repend 1933 20f9 ff .byte.b $ff 1932 20f9 repend 1933 20fa ff .byte.b $ff 1932 20fa repend 1933 20fb ff .byte.b $ff 1932 20fb repend 1933 20fc ff .byte.b $ff 1932 20fc repend 1933 20fd ff .byte.b $ff 1932 20fd repend 1933 20fe ff .byte.b $ff 1932 20fe repend 1933 20ff ff .byte.b $ff 1934 2100 repend 1935 2100 ; Provided under the CC0 license. See the included LICENSE.txt for details. 1936 2100 1937 2100 ; This is a 2-line kernel! 1938 2100 ifnconst vertical_reflect 1939 2100 kernel 1940 2100 endif 1941 2100 85 02 sta WSYNC 1942 2102 a9 ff lda #255 1943 2104 8d 96 02 sta TIM64T 1944 2107 1945 2107 a9 01 lda #1 1946 2109 85 27 sta VDELBL 1947 210b 85 25 sta VDELP0 1948 210d a6 92 ldx ballheight 1949 210f e8 inx 1950 2110 e8 inx 1951 2111 86 9f stx temp4 1952 2113 a5 86 lda player1y 1953 2115 85 9e sta temp3 1954 2117 1955 2117 - ifconst shakescreen 1956 2117 - jsr doshakescreen 1957 2117 else 1958 2117 a6 90 ldx missile0height 1959 2119 e8 inx 1960 211a endif 1961 211a 1962 211a e8 inx 1963 211b 86 f6 stx stack1 1964 211d 1965 211d a5 89 lda bally 1966 211f 85 f7 sta stack2 1967 2121 1968 2121 a5 85 lda player0y 1969 2123 a2 00 ldx #0 1970 2125 85 02 sta WSYNC 1971 2127 86 1b stx GRP0 1972 2129 86 1c stx GRP1 1973 212b 86 0e stx PF1L 1974 212d 86 0f stx PF2 1975 212f 86 2c stx CXCLR 1976 2131 - ifconst readpaddle 1977 2131 - stx paddle 1978 2131 else 0 2131 sleep 3 1 2131 .CYCLES SET 3 2 2131 3 2131 - IF .CYCLES < 2 4 2131 - ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 5 2131 - ERR 6 2131 ENDIF 7 2131 8 2131 IF .CYCLES & 1 9 2131 IFNCONST NO_ILLEGAL_OPCODES 10 2131 04 00 nop 0 11 2133 - ELSE 12 2133 - bit VSYNC 13 2133 ENDIF 14 2133 .CYCLES SET .CYCLES - 3 15 2133 ENDIF 16 2133 17 2133 - REPEAT .CYCLES / 2 18 2133 - nop 19 2133 REPEND 1980 2133 endif 1981 2133 1982 2133 95 9d sta temp2,x 1983 2135 1984 2135 ;store these so they can be retrieved later 1985 2135 ifnconst pfres 1986 2135 a2 54 ldx #128-44+(4-pfwidth)*12 1987 2137 - else 1988 2137 - ldx #132-pfres*pfwidth 1989 2137 endif 1990 2137 1991 2137 c6 85 dec player0y 1992 2139 1993 2139 a5 91 lda missile0y 1994 213b 85 a0 sta temp5 1995 213d a5 88 lda missile1y 1996 213f 85 a1 sta temp6 1997 2141 1998 2141 a5 d5 lda playfieldpos 1999 2143 85 9c sta temp1 2000 2145 2001 2145 - ifconst pfrowheight 2002 2145 - lda #pfrowheight+2 2003 2145 else 2004 2145 ifnconst pfres 2005 2145 a9 0a lda #10 2006 2147 - else 2007 2147 - lda #(96/pfres)+2 ; try to come close to the real size 2008 2147 endif 2009 2147 endif 2010 2147 18 clc 2011 2148 e5 d5 sbc playfieldpos 2012 214a 85 d5 sta playfieldpos 2013 214c 4c 78 f1 jmp .startkernel 2014 214f 2015 214f .skipDrawP0 2016 214f a9 00 lda #0 2017 2151 a8 tay 2018 2152 4c aa f1 jmp .continueP0 2019 2155 2020 2155 .skipDrawP1 2021 2155 a9 00 lda #0 2022 2157 a8 tay 2023 2158 4c 82 f1 jmp .continueP1 2024 215b 2025 215b .kerloop ; enter at cycle 59?? 2026 215b 2027 215b continuekernel 0 215b sleep 2 1 215b .CYCLES SET 2 2 215b 3 215b - IF .CYCLES < 2 4 215b - ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 5 215b - ERR 6 215b ENDIF 7 215b 8 215b - IF .CYCLES & 1 9 215b - IFNCONST NO_ILLEGAL_OPCODES 10 215b - nop 0 11 215b - ELSE 12 215b - bit VSYNC 13 215b - ENDIF 14 215b -.CYCLES SET .CYCLES - 3 15 215b ENDIF 16 215b 17 215b REPEAT .CYCLES / 2 18 215b ea nop 19 215c REPEND 2029 215c continuekernel2 2030 215c a5 92 lda ballheight 2031 215e 2032 215e - ifconst pfres 2033 215e - ldy playfield+pfres*pfwidth-132,x 2034 215e - sty PF1L ;3 2035 215e - ldy playfield+pfres*pfwidth-131-pfadjust,x 2036 215e - sty PF2L ;3 2037 215e - ldy playfield+pfres*pfwidth-129,x 2038 215e - sty PF1R ; 3 too early? 2039 215e - ldy playfield+pfres*pfwidth-130-pfadjust,x 2040 215e - sty PF2R ;3 2041 215e else 2042 215e bc 7c 10 ldy playfield-48+pfwidth*12+44-128,x 2043 2161 84 0e sty PF1L ;3 2044 2163 bc 7d 10 ldy playfield-48+pfwidth*12+45-128-pfadjust,x ;4 2045 2166 84 0f sty PF2L ;3 2046 2168 bc 7f 10 ldy playfield-48+pfwidth*12+47-128,x ;4 2047 216b 84 0e sty PF1R ; 3 too early? 2048 216d bc 7e 10 ldy playfield-48+pfwidth*12+46-128-pfadjust,x ;4 2049 2170 84 0f sty PF2R ;3 2050 2172 endif 2051 2172 2052 2172 ; should be playfield+$38 for width=2 2053 2172 2054 2172 c7 89 dcp bally 2055 2174 2a rol 2056 2175 2a rol 2057 2176 ; rol 2058 2176 ; rol 2059 2176 goback 2060 2176 85 1f sta ENABL 2061 2178 .startkernel 2062 2178 a5 8f lda player1height ;3 2063 217a c7 86 dcp player1y ;5 2064 217c 90 d7 bcc .skipDrawP1 ;2 2065 217e a4 86 ldy player1y ;3 2066 2180 b1 8c lda (player1pointer),y ;5; player0pointer must be selected carefully by the compiler 2067 2182 ; so it doesn't cross a page boundary! 2068 2182 2069 2182 .continueP1 2070 2182 85 1c sta GRP1 ;3 2071 2184 2072 2184 - ifnconst player1colors 2073 2184 - lda missile1height ;3 2074 2184 - dcp missile1y ;5 2075 2184 - rol ;2 2076 2184 - rol ;2 2077 2184 - sta ENAM1 ;3 2078 2184 else 2079 2184 b1 87 lda (player1color),y 2080 2186 85 07 sta COLUP1 2081 2188 ifnconst playercolors 0 2188 sleep 7 1 2188 .CYCLES SET 7 2 2188 3 2188 - IF .CYCLES < 2 4 2188 - ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 5 2188 - ERR 6 2188 ENDIF 7 2188 8 2188 IF .CYCLES & 1 9 2188 IFNCONST NO_ILLEGAL_OPCODES 10 2188 04 00 nop 0 11 218a - ELSE 12 218a - bit VSYNC 13 218a ENDIF 14 218a .CYCLES SET .CYCLES - 3 15 218a ENDIF 16 218a 17 218a REPEAT .CYCLES / 2 18 218a ea nop 17 218a REPEND 18 218b ea nop 19 218c REPEND 2083 218c - else 2084 218c - lda.w player0colorstore 2085 218c - sta COLUP0 2086 218c endif 2087 218c endif 2088 218c 2089 218c - ifconst pfres 2090 218c - lda playfield+pfres*pfwidth-132,x 2091 218c - sta PF1L ;3 2092 218c - lda playfield+pfres*pfwidth-131-pfadjust,x 2093 218c - sta PF2L ;3 2094 218c - lda playfield+pfres*pfwidth-129,x 2095 218c - sta PF1R ; 3 too early? 2096 218c - lda playfield+pfres*pfwidth-130-pfadjust,x 2097 218c - sta PF2R ;3 2098 218c else 2099 218c bd 7c 10 lda playfield-48+pfwidth*12+44-128,x ;4 2100 218f 85 0e sta PF1L ;3 2101 2191 bd 7d 10 lda playfield-48+pfwidth*12+45-128-pfadjust,x ;4 2102 2194 85 0f sta PF2L ;3 2103 2196 bd 7f 10 lda playfield-48+pfwidth*12+47-128,x ;4 2104 2199 85 0e sta PF1R ; 3 too early? 2105 219b bd 7e 10 lda playfield-48+pfwidth*12+46-128-pfadjust,x ;4 2106 219e 85 0f sta PF2R ;3 2107 21a0 endif 2108 21a0 ; sleep 3 2109 21a0 2110 21a0 a5 8e lda player0height 2111 21a2 c7 85 dcp player0y 2112 21a4 90 a9 bcc .skipDrawP0 2113 21a6 a4 85 ldy player0y 2114 21a8 b1 8a lda (player0pointer),y 2115 21aa .continueP0 2116 21aa 85 1b sta GRP0 2117 21ac 2118 21ac - ifnconst no_blank_lines 2119 21ac - ifnconst playercolors 2120 21ac - lda missile0height ;3 2121 21ac - dcp missile0y ;5 2122 21ac - sbc stack1 2123 21ac - sta ENAM0 ;3 2124 21ac - else 2125 21ac - lda (player0color),y 2126 21ac - sta player0colorstore 2127 21ac - sleep 6 2128 21ac - endif 2129 21ac - dec temp1 2130 21ac - bne continuekernel 2131 21ac else 2132 21ac c6 9c dec temp1 2133 21ae f0 09 beq altkernel2 2134 21b0 - ifconst readpaddle 2135 21b0 - ldy currentpaddle 2136 21b0 - lda INPT0,y 2137 21b0 - bpl noreadpaddle 2138 21b0 - inc paddle 2139 21b0 - jmp continuekernel2 2140 21b0 -noreadpaddle 2141 21b0 - sleep 2 2142 21b0 - jmp continuekernel 2143 21b0 else 2144 21b0 ifnconst playercolors 2145 21b0 - ifconst PFcolors 2146 21b0 - txa 2147 21b0 - tay 2148 21b0 - lda (pfcolortable),y 2149 21b0 - ifnconst backgroundchange 2150 21b0 - sta COLUPF 2151 21b0 - else 2152 21b0 - sta COLUBK 2153 21b0 - endif 2154 21b0 - jmp continuekernel 2155 21b0 else 2156 21b0 - ifconst kernelmacrodef 2157 21b0 - kernelmacro 2158 21b0 else 0 21b0 sleep 12 1 21b0 .CYCLES SET 12 2 21b0 3 21b0 - IF .CYCLES < 2 4 21b0 - ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 5 21b0 - ERR 6 21b0 ENDIF 7 21b0 8 21b0 - IF .CYCLES & 1 9 21b0 - IFNCONST NO_ILLEGAL_OPCODES 10 21b0 - nop 0 11 21b0 - ELSE 12 21b0 - bit VSYNC 13 21b0 - ENDIF 14 21b0 -.CYCLES SET .CYCLES - 3 15 21b0 ENDIF 16 21b0 17 21b0 REPEAT .CYCLES / 2 18 21b0 ea nop 17 21b0 REPEND 18 21b1 ea nop 17 21b1 REPEND 18 21b2 ea nop 17 21b2 REPEND 18 21b3 ea nop 17 21b3 REPEND 18 21b4 ea nop 17 21b4 REPEND 18 21b5 ea nop 19 21b6 REPEND 2160 21b6 endif 2161 21b6 endif 2162 21b6 - else 2163 21b6 - lda (player0color),y 2164 21b6 - sta player0colorstore 2165 21b6 - sleep 4 2166 21b6 endif 2167 21b6 4c 5b f1 jmp continuekernel 2168 21b9 endif 2169 21b9 altkernel2 2170 21b9 8a txa 2171 21ba ifnconst vertical_reflect 2172 21ba cb fc sbx #256-pfwidth 2173 21bc - else 2174 21bc - sbx #256-pfwidth/2 2175 21bc endif 2176 21bc 30 1b bmi lastkernelline 2177 21be - ifconst pfrowheight 2178 21be - lda #pfrowheight 2179 21be else 2180 21be ifnconst pfres 2181 21be a9 08 lda #8 2182 21c0 - else 2183 21c0 - lda #(96/pfres) ; try to come close to the real size 2184 21c0 endif 2185 21c0 endif 2186 21c0 85 9c sta temp1 2187 21c2 4c 5b f1 jmp continuekernel 2188 21c5 endif 2189 21c5 2190 21c5 altkernel 2191 21c5 2192 21c5 - ifconst PFmaskvalue 2193 21c5 - lda #PFmaskvalue 2194 21c5 else 2195 21c5 a9 00 lda #0 2196 21c7 endif 2197 21c7 85 0e sta PF1L 2198 21c9 85 0f sta PF2 2199 21cb 2200 21cb 2201 21cb ;sleep 3 2202 21cb 2203 21cb ;28 cycles to fix things 2204 21cb ;minus 11=17 2205 21cb 2206 21cb ; lax temp4 2207 21cb ; clc 2208 21cb 8a txa 2209 21cc ifnconst vertical_reflect 2210 21cc cb fc sbx #256-pfwidth 2211 21ce - else 2212 21ce - sbx #256-pfwidth/2 2213 21ce endif 2214 21ce 2215 21ce 30 09 bmi lastkernelline 2216 21d0 2217 21d0 - ifconst PFcolorandheight 2218 21d0 - ifconst pfres 2219 21d0 - ldy playfieldcolorandheight-131+pfres*pfwidth,x 2220 21d0 - else 2221 21d0 - ldy playfieldcolorandheight-87,x 2222 21d0 - endif 2223 21d0 - ifnconst backgroundchange 2224 21d0 - sty COLUPF 2225 21d0 - else 2226 21d0 - sty COLUBK 2227 21d0 - endif 2228 21d0 - ifconst pfres 2229 21d0 - lda playfieldcolorandheight-132+pfres*pfwidth,x 2230 21d0 - else 2231 21d0 - lda playfieldcolorandheight-88,x 2232 21d0 - endif 2233 21d0 - sta.w temp1 2234 21d0 endif 2235 21d0 - ifconst PFheights 2236 21d0 - lsr 2237 21d0 - lsr 2238 21d0 - tay 2239 21d0 - lda (pfheighttable),y 2240 21d0 - sta.w temp1 2241 21d0 endif 2242 21d0 - ifconst PFcolors 2243 21d0 - tay 2244 21d0 - lda (pfcolortable),y 2245 21d0 - ifnconst backgroundchange 2246 21d0 - sta COLUPF 2247 21d0 - else 2248 21d0 - sta COLUBK 2249 21d0 - endif 2250 21d0 - ifconst pfrowheight 2251 21d0 - lda #pfrowheight 2252 21d0 - else 2253 21d0 - ifnconst pfres 2254 21d0 - lda #8 2255 21d0 - else 2256 21d0 - lda #(96/pfres) ; try to come close to the real size 2257 21d0 - endif 2258 21d0 - endif 2259 21d0 - sta temp1 2260 21d0 endif 2261 21d0 ifnconst PFcolorandheight 2262 21d0 ifnconst PFcolors 2263 21d0 ifnconst PFheights 2264 21d0 - ifnconst no_blank_lines 2265 21d0 - ; read paddle 0 2266 21d0 - ; lo-res paddle read 2267 21d0 - ; bit INPT0 2268 21d0 - ; bmi paddleskipread 2269 21d0 - ; inc paddle0 2270 21d0 - ;donepaddleskip 2271 21d0 - sleep 10 2272 21d0 - ifconst pfrowheight 2273 21d0 - lda #pfrowheight 2274 21d0 - else 2275 21d0 - ifnconst pfres 2276 21d0 - lda #8 2277 21d0 - else 2278 21d0 - lda #(96/pfres) ; try to come close to the real size 2279 21d0 - endif 2280 21d0 - endif 2281 21d0 - sta temp1 2282 21d0 endif 2283 21d0 endif 2284 21d0 endif 2285 21d0 endif 2286 21d0 2287 21d0 2288 21d0 a5 92 lda ballheight 2289 21d2 c7 89 dcp bally 2290 21d4 e5 9f sbc temp4 2291 21d6 2292 21d6 2293 21d6 4c 76 f1 jmp goback 2294 21d9 2295 21d9 2296 21d9 - ifnconst no_blank_lines 2297 21d9 -lastkernelline 2298 21d9 - ifnconst PFcolors 2299 21d9 - sleep 10 2300 21d9 - else 2301 21d9 - ldy #124 2302 21d9 - lda (pfcolortable),y 2303 21d9 - sta COLUPF 2304 21d9 - endif 2305 21d9 - 2306 21d9 - ifconst PFheights 2307 21d9 - ldx #1 2308 21d9 - ;sleep 4 2309 21d9 - sleep 3 ; this was over 1 cycle 2310 21d9 - else 2311 21d9 - ldx playfieldpos 2312 21d9 - ;sleep 3 2313 21d9 - sleep 2 ; this was over 1 cycle 2314 21d9 - endif 2315 21d9 - 2316 21d9 - jmp enterlastkernel 2317 21d9 - 2318 21d9 else 2319 21d9 lastkernelline 2320 21d9 2321 21d9 - ifconst PFheights 2322 21d9 - ldx #1 2323 21d9 - ;sleep 5 2324 21d9 - sleep 4 ; this was over 1 cycle 2325 21d9 else 2326 21d9 a6 d5 ldx playfieldpos 2327 21db ;sleep 4 0 21db sleep 3 ; this was over 1 cycle 1 21db .CYCLES SET 3 2 21db 3 21db - IF .CYCLES < 2 4 21db - ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 5 21db - ERR 6 21db ENDIF 7 21db 8 21db IF .CYCLES & 1 9 21db IFNCONST NO_ILLEGAL_OPCODES 10 21db 04 00 nop 0 11 21dd - ELSE 12 21dd - bit VSYNC 13 21dd ENDIF 14 21dd .CYCLES SET .CYCLES - 3 15 21dd ENDIF 16 21dd 17 21dd - REPEAT .CYCLES / 2 18 21dd - nop 19 21dd REPEND 2329 21dd endif 2330 21dd 2331 21dd e0 00 cpx #0 2332 21df d0 26 bne .enterfromNBL 2333 21e1 4c 68 f2 jmp no_blank_lines_bailout 2334 21e4 endif 2335 21e4 2336 21e4 if ((<*)>$d5) 2337 2200 00 00 00 00* align 256 2338 2200 endif 2339 2200 ; this is a kludge to prevent page wrapping - fix!!! 2340 2200 2341 2200 .skipDrawlastP1 2342 2200 a9 00 lda #0 2343 2202 a8 tay ; added so we don't cross a page 2344 2203 4c 2d f2 jmp .continuelastP1 2345 2206 2346 2206 .endkerloop ; enter at cycle 59?? 2347 2206 2348 2206 ea nop 2349 2207 2350 2207 .enterfromNBL 2351 2207 - ifconst pfres 2352 2207 - ldy.w playfield+pfres*pfwidth-4 2353 2207 - sty PF1L ;3 2354 2207 - ldy.w playfield+pfres*pfwidth-3-pfadjust 2355 2207 - sty PF2L ;3 2356 2207 - ldy.w playfield+pfres*pfwidth-1 2357 2207 - sty PF1R ; possibly too early? 2358 2207 - ldy.w playfield+pfres*pfwidth-2-pfadjust 2359 2207 - sty PF2R ;3 2360 2207 else 2361 2207 ac fc 10 ldy.w playfield-48+pfwidth*12+44 2362 220a 84 0e sty PF1L ;3 2363 220c ac fd 10 ldy.w playfield-48+pfwidth*12+45-pfadjust 2364 220f 84 0f sty PF2L ;3 2365 2211 ac ff 10 ldy.w playfield-48+pfwidth*12+47 2366 2214 84 0e sty PF1R ; possibly too early? 2367 2216 ac fe 10 ldy.w playfield-48+pfwidth*12+46-pfadjust 2368 2219 84 0f sty PF2R ;3 2369 221b endif 2370 221b 2371 221b enterlastkernel 2372 221b a5 92 lda ballheight 2373 221d 2374 221d ; tya 2375 221d c7 89 dcp bally 2376 221f ; sleep 4 2377 221f 2378 221f ; sbc stack3 2379 221f 2a rol 2380 2220 2a rol 2381 2221 85 1f sta ENABL 2382 2223 2383 2223 a5 8f lda player1height ;3 2384 2225 c7 86 dcp player1y ;5 2385 2227 90 d7 bcc .skipDrawlastP1 2386 2229 a4 86 ldy player1y ;3 2387 222b b1 8c lda (player1pointer),y ;5; player0pointer must be selected carefully by the compiler 2388 222d ; so it doesn't cross a page boundary! 2389 222d 2390 222d .continuelastP1 2391 222d 85 1c sta GRP1 ;3 2392 222f 2393 222f - ifnconst player1colors 2394 222f - lda missile1height ;3 2395 222f - dcp missile1y ;5 2396 222f else 2397 222f b1 87 lda (player1color),y 2398 2231 85 07 sta COLUP1 2399 2233 endif 2400 2233 2401 2233 ca dex 2402 2234 ;dec temp4 ; might try putting this above PF writes 2403 2234 f0 34 beq endkernel 2404 2236 2405 2236 2406 2236 - ifconst pfres 2407 2236 - ldy.w playfield+pfres*pfwidth-4 2408 2236 - sty PF1L ;3 2409 2236 - ldy.w playfield+pfres*pfwidth-3-pfadjust 2410 2236 - sty PF2L ;3 2411 2236 - ldy.w playfield+pfres*pfwidth-1 2412 2236 - sty PF1R ; possibly too early? 2413 2236 - ldy.w playfield+pfres*pfwidth-2-pfadjust 2414 2236 - sty PF2R ;3 2415 2236 else 2416 2236 ac fc 10 ldy.w playfield-48+pfwidth*12+44 2417 2239 84 0e sty PF1L ;3 2418 223b ac fd 10 ldy.w playfield-48+pfwidth*12+45-pfadjust 2419 223e 84 0f sty PF2L ;3 2420 2240 ac ff 10 ldy.w playfield-48+pfwidth*12+47 2421 2243 84 0e sty PF1R ; possibly too early? 2422 2245 ac fe 10 ldy.w playfield-48+pfwidth*12+46-pfadjust 2423 2248 84 0f sty PF2R ;3 2424 224a endif 2425 224a 2426 224a - ifnconst player1colors 2427 224a - rol ;2 2428 224a - rol ;2 2429 224a - sta ENAM1 ;3 2430 224a else 2431 224a ifnconst playercolors 0 224a sleep 7 1 224a .CYCLES SET 7 2 224a 3 224a - IF .CYCLES < 2 4 224a - ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 5 224a - ERR 6 224a ENDIF 7 224a 8 224a IF .CYCLES & 1 9 224a IFNCONST NO_ILLEGAL_OPCODES 10 224a 04 00 nop 0 11 224c - ELSE 12 224c - bit VSYNC 13 224c ENDIF 14 224c .CYCLES SET .CYCLES - 3 15 224c ENDIF 16 224c 17 224c REPEAT .CYCLES / 2 18 224c ea nop 17 224c REPEND 18 224d ea nop 19 224e REPEND 2433 224e - else 2434 224e - lda.w player0colorstore 2435 224e - sta COLUP0 2436 224e endif 2437 224e endif 2438 224e 2439 224e ad 8e 00 lda.w player0height 2440 2251 c7 85 dcp player0y 2441 2253 90 0d bcc .skipDrawlastP0 2442 2255 a4 85 ldy player0y 2443 2257 b1 8a lda (player0pointer),y 2444 2259 .continuelastP0 2445 2259 85 1b sta GRP0 2446 225b 2447 225b 2448 225b 2449 225b - ifnconst no_blank_lines 2450 225b - lda missile0height ;3 2451 225b - dcp missile0y ;5 2452 225b - sbc stack1 2453 225b - sta ENAM0 ;3 2454 225b - jmp .endkerloop 2455 225b else 2456 225b - ifconst readpaddle 2457 225b - ldy currentpaddle 2458 225b - lda INPT0,y 2459 225b - bpl noreadpaddle2 2460 225b - inc paddle 2461 225b - jmp .endkerloop 2462 225b -noreadpaddle2 2463 225b - sleep 4 2464 225b - jmp .endkerloop 2465 225b else ; no_blank_lines and no paddle reading 2466 225b 68 pla 2467 225c 48 pha ; 14 cycles in 4 bytes 2468 225d 68 pla 2469 225e 48 pha 2470 225f ; sleep 14 2471 225f 4c 06 f2 jmp .endkerloop 2472 2262 endif 2473 2262 endif 2474 2262 2475 2262 2476 2262 ; ifconst donepaddleskip 2477 2262 ;paddleskipread 2478 2262 ; this is kind of lame, since it requires 4 cycles from a page boundary crossing 2479 2262 ; plus we get a lo-res paddle read 2480 2262 ; bmi donepaddleskip 2481 2262 ; endif 2482 2262 2483 2262 .skipDrawlastP0 2484 2262 a9 00 lda #0 2485 2264 a8 tay 2486 2265 4c 59 f2 jmp .continuelastP0 2487 2268 2488 2268 ifconst no_blank_lines 2489 2268 no_blank_lines_bailout 2490 2268 a2 00 ldx #0 2491 226a endif 2492 226a 2493 226a endkernel 2494 226a ; 6 digit score routine 2495 226a 86 0e stx PF1 2496 226c 86 0f stx PF2 2497 226e 86 0d stx PF0 2498 2270 18 clc 2499 2271 2500 2271 - ifconst pfrowheight 2501 2271 - lda #pfrowheight+2 2502 2271 else 2503 2271 ifnconst pfres 2504 2271 a9 0a lda #10 2505 2273 - else 2506 2273 - lda #(96/pfres)+2 ; try to come close to the real size 2507 2273 endif 2508 2273 endif 2509 2273 2510 2273 e5 d5 sbc playfieldpos 2511 2275 85 d5 sta playfieldpos 2512 2277 8a txa 2513 2278 2514 2278 - ifconst shakescreen 2515 2278 - bit shakescreen 2516 2278 - bmi noshakescreen2 2517 2278 - ldx #$3D 2518 2278 -noshakescreen2 2519 2278 endif 2520 2278 2521 2278 95 02 sta WSYNC,x 2522 227a 2523 227a ; STA WSYNC ;first one, need one more 2524 227a 85 0b sta REFP0 2525 227c 85 0c sta REFP1 2526 227e 85 1b STA GRP0 2527 2280 85 1c STA GRP1 2528 2282 ; STA PF1 2529 2282 ; STA PF2 2530 2282 85 2b sta HMCLR 2531 2284 85 1d sta ENAM0 2532 2286 85 1e sta ENAM1 2533 2288 85 1f sta ENABL 2534 228a 2535 228a a5 9d lda temp2 ;restore variables that were obliterated by kernel 2536 228c 85 85 sta player0y 2537 228e a5 9e lda temp3 2538 2290 85 86 sta player1y 2539 2292 - ifnconst player1colors 2540 2292 - lda temp6 2541 2292 - sta missile1y 2542 2292 endif 2543 2292 ifnconst playercolors 2544 2292 ifnconst readpaddle 2545 2292 a5 a0 lda temp5 2546 2294 85 91 sta missile0y 2547 2296 endif 2548 2296 endif 2549 2296 a5 f7 lda stack2 2550 2298 85 89 sta bally 2551 229a 2552 229a ; strangely, this isn't required any more. might have 2553 229a ; resulted from the no_blank_lines score bounce fix 2554 229a ;ifconst no_blank_lines 2555 229a ;sta WSYNC 2556 229a ;endif 2557 229a 2558 229a ad 84 02 lda INTIM 2559 229d 18 clc 2560 229e - ifnconst vblank_time 2561 229e - adc #43+12+87 2562 229e else 2563 229e 69 8e adc #vblank_time+12+87 2564 22a0 2565 22a0 endif 2566 22a0 ; sta WSYNC 2567 22a0 8d 96 02 sta TIM64T 2568 22a3 2569 22a3 - ifconst minikernel 2570 22a3 - jsr minikernel 2571 22a3 endif 2572 22a3 2573 22a3 ; now reassign temp vars for score pointers 2574 22a3 2575 22a3 ; score pointers contain: 2576 22a3 ; score1-5: lo1,lo2,lo3,lo4,lo5,lo6 2577 22a3 ; swap lo2->temp1 2578 22a3 ; swap lo4->temp3 2579 22a3 ; swap lo6->temp5 2580 22a3 ifnconst noscore 2581 22a3 a5 97 lda scorepointers+1 2582 22a5 ; ldy temp1 2583 22a5 85 9c sta temp1 2584 22a7 ; sty scorepointers+1 2585 22a7 2586 22a7 a5 99 lda scorepointers+3 2587 22a9 ; ldy temp3 2588 22a9 85 9e sta temp3 2589 22ab ; sty scorepointers+3 2590 22ab 2591 22ab 2592 22ab 85 2b sta HMCLR 2593 22ad ba tsx 2594 22ae 86 f6 stx stack1 2595 22b0 a2 e0 ldx #$E0 2596 22b2 86 20 stx HMP0 2597 22b4 2598 22b4 a5 a3 LDA scorecolor 2599 22b6 85 06 STA COLUP0 2600 22b8 85 07 STA COLUP1 2601 22ba - ifconst scorefade 2602 22ba - STA stack2 2603 22ba endif 2604 22ba ifconst pfscore 2605 22ba a5 f4 lda pfscorecolor 2606 22bc 85 08 sta COLUPF 2607 22be endif 2608 22be 85 02 sta WSYNC 2609 22c0 a2 00 ldx #0 2610 22c2 86 1b STx GRP0 2611 22c4 86 1c STx GRP1 ; seems to be needed because of vdel 2612 22c6 2613 22c6 a5 9b lda scorepointers+5 2614 22c8 ; ldy temp5 2615 22c8 95 a0 sta temp5,x 2616 22ca ; sty scorepointers+5 2617 22ca a9 ff lda #>scoretable 2618 22cc 85 97 sta scorepointers+1 2619 22ce 85 99 sta scorepointers+3 2620 22d0 85 9b sta scorepointers+5 2621 22d2 85 9d sta temp2 2622 22d4 85 9f sta temp4 2623 22d6 85 a1 sta temp6 2624 22d8 a0 07 LDY #7 2625 22da 84 25 STY VDELP0 2626 22dc 85 10 STA RESP0 2627 22de 85 11 STA RESP1 2628 22e0 2629 22e0 2630 22e0 a9 03 LDA #$03 2631 22e2 85 04 STA NUSIZ0 2632 22e4 85 05 STA NUSIZ1 2633 22e6 85 26 STA VDELP1 2634 22e8 a9 f0 LDA #$F0 2635 22ea 85 21 STA HMP1 2636 22ec b1 96 lda (scorepointers),y 2637 22ee 85 1b sta GRP0 2638 22f0 85 2a STA HMOVE ; cycle 73 ? 2639 22f2 4c 09 f3 jmp beginscore 2640 22f5 2641 22f5 2642 22f5 if ((<*)>$d4) 2643 2300 00 00 00 00* align 256 ; kludge that potentially wastes space! should be fixed! 2644 2300 endif 2645 2300 2646 2300 loop2 2647 2300 b1 96 lda (scorepointers),y ;+5 68 204 2648 2302 85 1b sta GRP0 ;+3 71 213 D1 -- -- -- 2649 2304 ifconst pfscore 2650 2304 ad f2 00 lda.w pfscore1 2651 2307 85 0e sta PF1 2652 2309 - else 2653 2309 - ifconst scorefade 2654 2309 - sleep 2 2655 2309 - dec stack2 ; decrement the temporary scorecolor 2656 2309 - else 2657 2309 - sleep 7 2658 2309 - endif 2659 2309 endif 2660 2309 ; cycle 0 2661 2309 beginscore 2662 2309 b1 9e lda (scorepointers+$8),y ;+5 5 15 2663 230b 85 1c sta GRP1 ;+3 8 24 D1 D1 D2 -- 2664 230d b1 9c lda (scorepointers+$6),y ;+5 13 39 2665 230f 85 1b sta GRP0 ;+3 16 48 D3 D1 D2 D2 2666 2311 b3 98 lax (scorepointers+$2),y ;+5 29 87 2667 2313 9a txs 2668 2314 b3 9a lax (scorepointers+$4),y ;+5 36 108 2669 2316 - ifconst scorefade 2670 2316 - lda stack2 2671 2316 else 0 2316 sleep 3 1 2316 .CYCLES SET 3 2 2316 3 2316 - IF .CYCLES < 2 4 2316 - ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 5 2316 - ERR 6 2316 ENDIF 7 2316 8 2316 IF .CYCLES & 1 9 2316 IFNCONST NO_ILLEGAL_OPCODES 10 2316 04 00 nop 0 11 2318 - ELSE 12 2318 - bit VSYNC 13 2318 ENDIF 14 2318 .CYCLES SET .CYCLES - 3 15 2318 ENDIF 16 2318 17 2318 - REPEAT .CYCLES / 2 18 2318 - nop 19 2318 REPEND 2673 2318 endif 2674 2318 2675 2318 ifconst pfscore 2676 2318 a5 f3 lda pfscore2 2677 231a 85 0e sta PF1 2678 231c - else 2679 231c - ifconst scorefade 2680 231c - sta COLUP0 2681 231c - sta COLUP1 2682 231c - else 2683 231c - sleep 6 2684 231c - endif 2685 231c endif 2686 231c 2687 231c b1 a0 lda (scorepointers+$A),y ;+5 21 63 2688 231e 86 1c stx GRP1 ;+3 44 132 D3 D3 D4 D2! 2689 2320 ba tsx 2690 2321 86 1b stx GRP0 ;+3 47 141 D5 D3! D4 D4 2691 2323 85 1c sta GRP1 ;+3 50 150 D5 D5 D6 D4! 2692 2325 84 1b sty GRP0 ;+3 53 159 D4* D5! D6 D6 2693 2327 88 dey 2694 2328 10 d6 bpl loop2 ;+2 60 180 2695 232a 2696 232a a6 f6 ldx stack1 2697 232c 9a txs 2698 232d ; lda scorepointers+1 2699 232d a4 9c ldy temp1 2700 232f ; sta temp1 2701 232f 84 97 sty scorepointers+1 2702 2331 2703 2331 a9 00 LDA #0 2704 2333 85 0e sta PF1 2705 2335 85 1b STA GRP0 2706 2337 85 1c STA GRP1 2707 2339 85 25 STA VDELP0 2708 233b 85 26 STA VDELP1 ;do we need these 2709 233d 85 04 STA NUSIZ0 2710 233f 85 05 STA NUSIZ1 2711 2341 2712 2341 ; lda scorepointers+3 2713 2341 a4 9e ldy temp3 2714 2343 ; sta temp3 2715 2343 84 99 sty scorepointers+3 2716 2345 2717 2345 ; lda scorepointers+5 2718 2345 a4 a0 ldy temp5 2719 2347 ; sta temp5 2720 2347 84 9b sty scorepointers+5 2721 2349 endif ;noscore 2722 2349 - ifconst readpaddle 2723 2349 - lda #%11000010 2724 2349 else 2725 2349 - ifconst qtcontroller 2726 2349 - lda qtcontroller 2727 2349 - lsr ; bit 0 in carry 2728 2349 - lda #4 2729 2349 - ror ; carry into top of A 2730 2349 else 2731 2349 a9 02 lda #2 2732 234b endif ; qtcontroller 2733 234b endif ; readpaddle 2734 234b 85 02 sta WSYNC 2735 234d 85 01 sta VBLANK 0 234f RETURN 1 234f - ifnconst bankswitch 2 234f - rts 3 234f else 4 234f 4c dd ff jmp BS_return 5 2352 endif 2737 2352 - ifconst shakescreen 2738 2352 -doshakescreen 2739 2352 - bit shakescreen 2740 2352 - bmi noshakescreen 2741 2352 - sta WSYNC 2742 2352 -noshakescreen 2743 2352 - ldx missile0height 2744 2352 - inx 2745 2352 - rts 2746 2352 endif 2747 2352 2748 2352 start 2749 2352 78 sei 2750 2353 d8 cld 2751 2354 a0 00 ldy #0 2752 2356 a5 d0 lda $D0 2753 2358 c9 2c cmp #$2C ;check RAM location #1 2754 235a d0 07 bne MachineIs2600 2755 235c a5 d1 lda $D1 2756 235e c9 a9 cmp #$A9 ;check RAM location #2 2757 2360 d0 01 bne MachineIs2600 2758 2362 88 dey 2759 2363 MachineIs2600 2760 2363 a2 00 ldx #0 2761 2365 8a txa 2762 2366 clearmem 2763 2366 e8 inx 2764 2367 9a txs 2765 2368 48 pha 2766 2369 d0 fb bne clearmem 2767 236b 84 9c sty temp1 2768 236d ifnconst multisprite 2769 236d - ifconst pfrowheight 2770 236d - lda #pfrowheight 2771 236d else 2772 236d - ifconst pfres 2773 236d - lda #(96/pfres) 2774 236d else 2775 236d a9 08 lda #8 2776 236f endif 2777 236f endif 2778 236f 85 d5 sta playfieldpos 2779 2371 endif 2780 2371 a2 05 ldx #5 2781 2373 initscore 2782 2373 a9 74 lda #(game-1) 2799 2385 48 pha 2800 2386 a9 24 lda #<(game-1) 2801 2388 48 pha 2802 2389 48 pha 2803 238a 48 pha 2804 238b a2 01 ldx #1 2805 238d 4c eb ff jmp BS_jsr 2806 2390 endif 2807 2390 ; playfield drawing routines 2808 2390 ; you get a 32x12 bitmapped display in a single color :) 2809 2390 ; 0-31 and 0-11 2810 2390 2811 2390 pfclear ; clears playfield - or fill with pattern 2812 2390 - ifconst pfres 2813 2390 - ldx #pfres*pfwidth-1 2814 2390 else 2815 2390 a2 2f ldx #47-(4-pfwidth)*12 ; will this work? 2816 2392 endif 2817 2392 pfclear_loop 2818 2392 - ifnconst superchip 2819 2392 - sta playfield,x 2820 2392 else 2821 2392 9d 50 10 sta playfield-128,x 2822 2395 endif 2823 2395 ca dex 2824 2396 10 fa bpl pfclear_loop 0 2398 RETURN 1 2398 - ifnconst bankswitch 2 2398 - rts 3 2398 else 4 2398 4c dd ff jmp BS_return 5 239b endif 2826 239b 2827 239b setuppointers 2828 239b 86 9d stx temp2 ; store on.off.flip value 2829 239d aa tax ; put x-value in x 2830 239e 4a lsr 2831 239f 4a lsr 2832 23a0 4a lsr ; divide x pos by 8 2833 23a1 85 9c sta temp1 2834 23a3 98 tya 2835 23a4 0a asl 2836 23a5 if pfwidth=4 2837 23a5 0a asl ; multiply y pos by 4 2838 23a6 endif ; else multiply by 2 2839 23a6 18 clc 2840 23a7 65 9c adc temp1 ; add them together to get actual memory location offset 2841 23a9 a8 tay ; put the value in y 2842 23aa a5 9d lda temp2 ; restore on.off.flip value 2843 23ac 60 rts 2844 23ad 2845 23ad pfread 2846 23ad ;x=xvalue, y=yvalue 2847 23ad 20 9b f3 jsr setuppointers 2848 23b0 bd 45 f4 lda setbyte,x 2849 23b3 39 d0 10 and playfield,y 2850 23b6 5d 45 f4 eor setbyte,x 2851 23b9 ; beq readzero 2852 23b9 ; lda #1 2853 23b9 ; readzero 0 23b9 RETURN 1 23b9 - ifnconst bankswitch 2 23b9 - rts 3 23b9 else 4 23b9 4c dd ff jmp BS_return 5 23bc endif 2855 23bc 2856 23bc pfpixel 2857 23bc ;x=xvalue, y=yvalue, a=0,1,2 2858 23bc 20 9b f3 jsr setuppointers 2859 23bf 2860 23bf ifconst bankswitch 2861 23bf a5 9d lda temp2 ; load on.off.flip value (0,1, or 2) 2862 23c1 f0 0f beq pixelon_r ; if "on" go to on 2863 23c3 4a lsr 2864 23c4 b0 18 bcs pixeloff_r ; value is 1 if true 2865 23c6 b9 d0 10 lda playfield,y ; if here, it's "flip" 2866 23c9 5d 45 f4 eor setbyte,x 2867 23cc ifconst superchip 2868 23cc 99 50 10 sta playfield-128,y 2869 23cf - else 2870 23cf - sta playfield,y 2871 23cf endif 0 23cf RETURN 1 23cf - ifnconst bankswitch 2 23cf - rts 3 23cf else 4 23cf 4c dd ff jmp BS_return 5 23d2 endif 2873 23d2 pixelon_r 2874 23d2 b9 d0 10 lda playfield,y 2875 23d5 1d 45 f4 ora setbyte,x 2876 23d8 ifconst superchip 2877 23d8 99 50 10 sta playfield-128,y 2878 23db - else 2879 23db - sta playfield,y 2880 23db endif 0 23db RETURN 1 23db - ifnconst bankswitch 2 23db - rts 3 23db else 4 23db 4c dd ff jmp BS_return 5 23de endif 2882 23de pixeloff_r 2883 23de bd 45 f4 lda setbyte,x 2884 23e1 49 ff eor #$ff 2885 23e3 39 d0 10 and playfield,y 2886 23e6 ifconst superchip 2887 23e6 99 50 10 sta playfield-128,y 2888 23e9 - else 2889 23e9 - sta playfield,y 2890 23e9 endif 0 23e9 RETURN 1 23e9 - ifnconst bankswitch 2 23e9 - rts 3 23e9 else 4 23e9 4c dd ff jmp BS_return 5 23ec endif 2892 23ec 2893 23ec - else 2894 23ec - jmp plotpoint 2895 23ec endif 2896 23ec 2897 23ec pfhline 2898 23ec ;x=xvalue, y=yvalue, a=0,1,2, temp3=endx 2899 23ec 20 9b f3 jsr setuppointers 2900 23ef 4c f9 f3 jmp noinc 2901 23f2 keepgoing 2902 23f2 e8 inx 2903 23f3 8a txa 2904 23f4 29 07 and #7 2905 23f6 d0 01 bne noinc 2906 23f8 c8 iny 2907 23f9 noinc 2908 23f9 20 1e f4 jsr plotpoint 2909 23fc e4 9e cpx temp3 2910 23fe 30 f2 bmi keepgoing 0 2400 RETURN 1 2400 - ifnconst bankswitch 2 2400 - rts 3 2400 else 4 2400 4c dd ff jmp BS_return 5 2403 endif 2912 2403 2913 2403 pfvline 2914 2403 ;x=xvalue, y=yvalue, a=0,1,2, temp3=endx 2915 2403 20 9b f3 jsr setuppointers 2916 2406 84 9c sty temp1 ; store memory location offset 2917 2408 e6 9e inc temp3 ; increase final x by 1 2918 240a a5 9e lda temp3 2919 240c 0a asl 2920 240d if pfwidth=4 2921 240d 0a asl ; multiply by 4 2922 240e endif ; else multiply by 2 2923 240e 85 9e sta temp3 ; store it 2924 2410 ; Thanks to Michael Rideout for fixing a bug in this code 2925 2410 ; right now, temp1=y=starting memory location, temp3=final 2926 2410 ; x should equal original x value 2927 2410 keepgoingy 2928 2410 20 1e f4 jsr plotpoint 2929 2413 c8 iny 2930 2414 c8 iny 2931 2415 if pfwidth=4 2932 2415 c8 iny 2933 2416 c8 iny 2934 2417 endif 2935 2417 c4 9e cpy temp3 2936 2419 30 f5 bmi keepgoingy 0 241b RETURN 1 241b - ifnconst bankswitch 2 241b - rts 3 241b else 4 241b 4c dd ff jmp BS_return 5 241e endif 2938 241e 2939 241e plotpoint 2940 241e a5 9d lda temp2 ; load on.off.flip value (0,1, or 2) 2941 2420 f0 0d beq pixelon ; if "on" go to on 2942 2422 4a lsr 2943 2423 b0 14 bcs pixeloff ; value is 1 if true 2944 2425 b9 d0 10 lda playfield,y ; if here, it's "flip" 2945 2428 5d 45 f4 eor setbyte,x 2946 242b ifconst superchip 2947 242b 99 50 10 sta playfield-128,y 2948 242e - else 2949 242e - sta playfield,y 2950 242e endif 2951 242e 60 rts 2952 242f pixelon 2953 242f b9 d0 10 lda playfield,y 2954 2432 1d 45 f4 ora setbyte,x 2955 2435 ifconst superchip 2956 2435 99 50 10 sta playfield-128,y 2957 2438 - else 2958 2438 - sta playfield,y 2959 2438 endif 2960 2438 60 rts 2961 2439 pixeloff 2962 2439 bd 45 f4 lda setbyte,x 2963 243c 49 ff eor #$ff 2964 243e 39 d0 10 and playfield,y 2965 2441 ifconst superchip 2966 2441 99 50 10 sta playfield-128,y 2967 2444 - else 2968 2444 - sta playfield,y 2969 2444 endif 2970 2444 60 rts 2971 2445 2972 2445 setbyte 2973 2445 ifnconst pfcenter 2974 2445 80 .byte.b $80 2975 2446 40 .byte.b $40 2976 2447 20 .byte.b $20 2977 2448 10 .byte.b $10 2978 2449 08 .byte.b $08 2979 244a 04 .byte.b $04 2980 244b 02 .byte.b $02 2981 244c 01 .byte.b $01 2982 244d endif 2983 244d 01 .byte.b $01 2984 244e 02 .byte.b $02 2985 244f 04 .byte.b $04 2986 2450 08 .byte.b $08 2987 2451 10 .byte.b $10 2988 2452 20 .byte.b $20 2989 2453 40 .byte.b $40 2990 2454 80 .byte.b $80 2991 2455 80 .byte.b $80 2992 2456 40 .byte.b $40 2993 2457 20 .byte.b $20 2994 2458 10 .byte.b $10 2995 2459 08 .byte.b $08 2996 245a 04 .byte.b $04 2997 245b 02 .byte.b $02 2998 245c 01 .byte.b $01 2999 245d 01 .byte.b $01 3000 245e 02 .byte.b $02 3001 245f 04 .byte.b $04 3002 2460 08 .byte.b $08 3003 2461 10 .byte.b $10 3004 2462 20 .byte.b $20 3005 2463 40 .byte.b $40 3006 2464 80 .byte.b $80 3007 2465 pfscroll ;(a=0 left, 1 right, 2 up, 4 down, 6=upup, 12=downdown) 3008 2465 d0 2a bne notleft 3009 2467 ;left 3010 2467 - ifconst pfres 3011 2467 - ldx #pfres*4 3012 2467 else 3013 2467 a2 30 ldx #48 3014 2469 endif 3015 2469 leftloop 3016 2469 bd cf 10 lda playfield-1,x 3017 246c 4a lsr 3018 246d 3019 246d ifconst superchip 3020 246d bd ce 10 lda playfield-2,x 3021 2470 2a rol 3022 2471 9d 4e 10 sta playfield-130,x 3023 2474 bd cd 10 lda playfield-3,x 3024 2477 6a ror 3025 2478 9d 4d 10 sta playfield-131,x 3026 247b bd cc 10 lda playfield-4,x 3027 247e 2a rol 3028 247f 9d 4c 10 sta playfield-132,x 3029 2482 bd cf 10 lda playfield-1,x 3030 2485 6a ror 3031 2486 9d 4f 10 sta playfield-129,x 3032 2489 - else 3033 2489 - rol playfield-2,x 3034 2489 - ror playfield-3,x 3035 2489 - rol playfield-4,x 3036 2489 - ror playfield-1,x 3037 2489 endif 3038 2489 3039 2489 8a txa 3040 248a cb 04 sbx #4 3041 248c d0 db bne leftloop 0 248e RETURN 1 248e - ifnconst bankswitch 2 248e - rts 3 248e else 4 248e 4c dd ff jmp BS_return 5 2491 endif 3043 2491 3044 2491 notleft 3045 2491 4a lsr 3046 2492 90 2a bcc notright 3047 2494 ;right 3048 2494 3049 2494 - ifconst pfres 3050 2494 - ldx #pfres*4 3051 2494 else 3052 2494 a2 30 ldx #48 3053 2496 endif 3054 2496 rightloop 3055 2496 bd cc 10 lda playfield-4,x 3056 2499 4a lsr 3057 249a ifconst superchip 3058 249a bd cd 10 lda playfield-3,x 3059 249d 2a rol 3060 249e 9d 4d 10 sta playfield-131,x 3061 24a1 bd ce 10 lda playfield-2,x 3062 24a4 6a ror 3063 24a5 9d 4e 10 sta playfield-130,x 3064 24a8 bd cf 10 lda playfield-1,x 3065 24ab 2a rol 3066 24ac 9d 4f 10 sta playfield-129,x 3067 24af bd cc 10 lda playfield-4,x 3068 24b2 6a ror 3069 24b3 9d 4c 10 sta playfield-132,x 3070 24b6 - else 3071 24b6 - rol playfield-3,x 3072 24b6 - ror playfield-2,x 3073 24b6 - rol playfield-1,x 3074 24b6 - ror playfield-4,x 3075 24b6 endif 3076 24b6 8a txa 3077 24b7 cb 04 sbx #4 3078 24b9 d0 db bne rightloop 0 24bb RETURN 1 24bb - ifnconst bankswitch 2 24bb - rts 3 24bb else 4 24bb 4c dd ff jmp BS_return 5 24be endif 3080 24be 3081 24be notright 3082 24be 4a lsr 3083 24bf 90 5b bcc notup 3084 24c1 ;up 3085 24c1 4a lsr 3086 24c2 90 02 bcc onedecup 3087 24c4 c6 d5 dec playfieldpos 3088 24c6 onedecup 3089 24c6 c6 d5 dec playfieldpos 3090 24c8 f0 02 beq shiftdown 3091 24ca 10 4d bpl noshiftdown2 3092 24cc shiftdown 3093 24cc - ifconst pfrowheight 3094 24cc - lda #pfrowheight 3095 24cc else 3096 24cc ifnconst pfres 3097 24cc a9 08 lda #8 3098 24ce - else 3099 24ce - lda #(96/pfres) ; try to come close to the real size 3100 24ce endif 3101 24ce endif 3102 24ce 3103 24ce 85 d5 sta playfieldpos 3104 24d0 ad d3 10 lda playfield+3 3105 24d3 85 9f sta temp4 3106 24d5 ad d2 10 lda playfield+2 3107 24d8 85 9e sta temp3 3108 24da ad d1 10 lda playfield+1 3109 24dd 85 9d sta temp2 3110 24df ad d0 10 lda playfield 3111 24e2 85 9c sta temp1 3112 24e4 a2 00 ldx #0 3113 24e6 up2 3114 24e6 bd d4 10 lda playfield+4,x 3115 24e9 ifconst superchip 3116 24e9 9d 50 10 sta playfield-128,x 3117 24ec bd d5 10 lda playfield+5,x 3118 24ef 9d 51 10 sta playfield-127,x 3119 24f2 bd d6 10 lda playfield+6,x 3120 24f5 9d 52 10 sta playfield-126,x 3121 24f8 bd d7 10 lda playfield+7,x 3122 24fb 9d 53 10 sta playfield-125,x 3123 24fe - else 3124 24fe - sta playfield,x 3125 24fe - lda playfield+5,x 3126 24fe - sta playfield+1,x 3127 24fe - lda playfield+6,x 3128 24fe - sta playfield+2,x 3129 24fe - lda playfield+7,x 3130 24fe - sta playfield+3,x 3131 24fe endif 3132 24fe 8a txa 3133 24ff cb fc sbx #252 3134 2501 - ifconst pfres 3135 2501 - cpx #(pfres-1)*4 3136 2501 else 3137 2501 e0 2c cpx #44 3138 2503 endif 3139 2503 d0 e1 bne up2 3140 2505 3141 2505 a5 9f lda temp4 3142 2507 3143 2507 ifconst superchip 3144 2507 - ifconst pfres 3145 2507 - sta playfield+pfres*4-129 3146 2507 - lda temp3 3147 2507 - sta playfield+pfres*4-130 3148 2507 - lda temp2 3149 2507 - sta playfield+pfres*4-131 3150 2507 - lda temp1 3151 2507 - sta playfield+pfres*4-132 3152 2507 else 3153 2507 8d 7f 10 sta playfield+47-128 3154 250a a5 9e lda temp3 3155 250c 8d 7e 10 sta playfield+46-128 3156 250f a5 9d lda temp2 3157 2511 8d 7d 10 sta playfield+45-128 3158 2514 a5 9c lda temp1 3159 2516 8d 7c 10 sta playfield+44-128 3160 2519 endif 3161 2519 - else 3162 2519 - ifconst pfres 3163 2519 - sta playfield+pfres*4-1 3164 2519 - lda temp3 3165 2519 - sta playfield+pfres*4-2 3166 2519 - lda temp2 3167 2519 - sta playfield+pfres*4-3 3168 2519 - lda temp1 3169 2519 - sta playfield+pfres*4-4 3170 2519 - else 3171 2519 - sta playfield+47 3172 2519 - lda temp3 3173 2519 - sta playfield+46 3174 2519 - lda temp2 3175 2519 - sta playfield+45 3176 2519 - lda temp1 3177 2519 - sta playfield+44 3178 2519 - endif 3179 2519 endif 3180 2519 noshiftdown2 0 2519 RETURN 1 2519 - ifnconst bankswitch 2 2519 - rts 3 2519 else 4 2519 4c dd ff jmp BS_return 5 251c endif 3182 251c 3183 251c 3184 251c notup 3185 251c ;down 3186 251c 4a lsr 3187 251d b0 02 bcs oneincup 3188 251f e6 d5 inc playfieldpos 3189 2521 oneincup 3190 2521 e6 d5 inc playfieldpos 3191 2523 a5 d5 lda playfieldpos 3192 2525 3193 2525 - ifconst pfrowheight 3194 2525 - cmp #pfrowheight+1 3195 2525 else 3196 2525 ifnconst pfres 3197 2525 c9 09 cmp #9 3198 2527 - else 3199 2527 - cmp #(96/pfres)+1 ; try to come close to the real size 3200 2527 endif 3201 2527 endif 3202 2527 3203 2527 90 4b bcc noshiftdown 3204 2529 a9 01 lda #1 3205 252b 85 d5 sta playfieldpos 3206 252d 3207 252d - ifconst pfres 3208 252d - lda playfield+pfres*4-1 3209 252d - sta temp4 3210 252d - lda playfield+pfres*4-2 3211 252d - sta temp3 3212 252d - lda playfield+pfres*4-3 3213 252d - sta temp2 3214 252d - lda playfield+pfres*4-4 3215 252d else 3216 252d ad ff 10 lda playfield+47 3217 2530 85 9f sta temp4 3218 2532 ad fe 10 lda playfield+46 3219 2535 85 9e sta temp3 3220 2537 ad fd 10 lda playfield+45 3221 253a 85 9d sta temp2 3222 253c ad fc 10 lda playfield+44 3223 253f endif 3224 253f 3225 253f 85 9c sta temp1 3226 2541 3227 2541 - ifconst pfres 3228 2541 - ldx #(pfres-1)*4 3229 2541 else 3230 2541 a2 2c ldx #44 3231 2543 endif 3232 2543 down2 3233 2543 bd cf 10 lda playfield-1,x 3234 2546 ifconst superchip 3235 2546 9d 53 10 sta playfield-125,x 3236 2549 bd ce 10 lda playfield-2,x 3237 254c 9d 52 10 sta playfield-126,x 3238 254f bd cd 10 lda playfield-3,x 3239 2552 9d 51 10 sta playfield-127,x 3240 2555 bd cc 10 lda playfield-4,x 3241 2558 9d 50 10 sta playfield-128,x 3242 255b - else 3243 255b - sta playfield+3,x 3244 255b - lda playfield-2,x 3245 255b - sta playfield+2,x 3246 255b - lda playfield-3,x 3247 255b - sta playfield+1,x 3248 255b - lda playfield-4,x 3249 255b - sta playfield,x 3250 255b endif 3251 255b 8a txa 3252 255c cb 04 sbx #4 3253 255e d0 e3 bne down2 3254 2560 3255 2560 a5 9f lda temp4 3256 2562 ifconst superchip 3257 2562 8d 53 10 sta playfield-125 3258 2565 a5 9e lda temp3 3259 2567 8d 52 10 sta playfield-126 3260 256a a5 9d lda temp2 3261 256c 8d 51 10 sta playfield-127 3262 256f a5 9c lda temp1 3263 2571 8d 50 10 sta playfield-128 3264 2574 - else 3265 2574 - sta playfield+3 3266 2574 - lda temp3 3267 2574 - sta playfield+2 3268 2574 - lda temp2 3269 2574 - sta playfield+1 3270 2574 - lda temp1 3271 2574 - sta playfield 3272 2574 endif 3273 2574 noshiftdown 0 2574 RETURN 1 2574 - ifnconst bankswitch 2 2574 - rts 3 2574 else 4 2574 4c dd ff jmp BS_return 5 2577 endif 3275 2577 ;standard routines needed for pretty much all games 3276 2577 ; just the random number generator is left - maybe we should remove this asm file altogether? 3277 2577 ; repositioning code and score pointer setup moved to overscan 3278 2577 ; read switches, joysticks now compiler generated (more efficient) 3279 2577 3280 2577 randomize 3281 2577 a5 a2 lda rand 3282 2579 4a lsr 3283 257a - ifconst rand16 3284 257a - rol rand16 3285 257a endif 3286 257a 90 02 bcc noeor 3287 257c 49 b4 eor #$B4 3288 257e noeor 3289 257e 85 a2 sta rand 3290 2580 - ifconst rand16 3291 2580 - eor rand16 3292 2580 endif 0 2580 RETURN 1 2580 - ifnconst bankswitch 2 2580 - rts 3 2580 else 4 2580 4c dd ff jmp BS_return 5 2583 endif 3294 2583 drawscreen 3295 2583 - ifconst debugscore 3296 2583 - ldx #14 3297 2583 - lda INTIM ; display # cycles left in the score 3298 2583 - 3299 2583 - ifconst mincycles 3300 2583 - lda mincycles 3301 2583 - cmp INTIM 3302 2583 - lda mincycles 3303 2583 - bcc nochange 3304 2583 - lda INTIM 3305 2583 - sta mincycles 3306 2583 -nochange 3307 2583 - endif 3308 2583 - 3309 2583 - ; cmp #$2B 3310 2583 - ; bcs no_cycles_left 3311 2583 - bmi cycles_left 3312 2583 - ldx #64 3313 2583 - eor #$ff ;make negative 3314 2583 -cycles_left 3315 2583 - stx scorecolor 3316 2583 - and #$7f ; clear sign bit 3317 2583 - tax 3318 2583 - lda scorebcd,x 3319 2583 - sta score+2 3320 2583 - lda scorebcd1,x 3321 2583 - sta score+1 3322 2583 - jmp done_debugscore 3323 2583 -scorebcd 3324 2583 - .byte $00, $64, $28, $92, $56, $20, $84, $48, $12, $76, $40 3325 2583 - .byte $04, $68, $32, $96, $60, $24, $88, $52, $16, $80, $44 3326 2583 - .byte $08, $72, $36, $00, $64, $28, $92, $56, $20, $84, $48 3327 2583 - .byte $12, $76, $40, $04, $68, $32, $96, $60, $24, $88 3328 2583 -scorebcd1 3329 2583 - .byte 0, 0, 1, 1, 2, 3, 3, 4, 5, 5, 6 3330 2583 - .byte 7, 7, 8, 8, 9, $10, $10, $11, $12, $12, $13 3331 2583 - .byte $14, $14, $15, $16, $16, $17, $17, $18, $19, $19, $20 3332 2583 - .byte $21, $21, $22, $23, $23, $24, $24, $25, $26, $26 3333 2583 -done_debugscore 3334 2583 endif 3335 2583 3336 2583 - ifconst debugcycles 3337 2583 - lda INTIM ; if we go over, it mucks up the background color 3338 2583 - ; cmp #$2B 3339 2583 - ; BCC overscan 3340 2583 - bmi overscan 3341 2583 - sta COLUBK 3342 2583 - bcs doneoverscan 3343 2583 endif 3344 2583 3345 2583 overscan 3346 2583 - ifconst interlaced 3347 2583 - PHP 3348 2583 - PLA 3349 2583 - EOR #4 ; flip interrupt bit 3350 2583 - PHA 3351 2583 - PLP 3352 2583 - AND #4 ; isolate the interrupt bit 3353 2583 - TAX ; save it for later 3354 2583 endif 3355 2583 3356 2583 overscanloop 3357 2583 ad 84 02 lda INTIM ;wait for sync 3358 2586 30 fb bmi overscanloop 3359 2588 doneoverscan 3360 2588 3361 2588 ;do VSYNC 3362 2588 3363 2588 - ifconst interlaced 3364 2588 - CPX #4 3365 2588 - BNE oddframevsync 3366 2588 endif 3367 2588 3368 2588 a9 02 lda #2 3369 258a 85 02 sta WSYNC 3370 258c 85 00 sta VSYNC 3371 258e 85 02 STA WSYNC 3372 2590 85 02 STA WSYNC 3373 2592 4a lsr 3374 2593 85 02 STA WSYNC 3375 2595 85 00 STA VSYNC 3376 2597 85 01 sta VBLANK 3377 2599 - ifnconst overscan_time 3378 2599 - lda #37+128 3379 2599 else 3380 2599 a9 a5 lda #overscan_time+128 3381 259b endif 3382 259b 8d 96 02 sta TIM64T 3383 259e 3384 259e - ifconst interlaced 3385 259e - jmp postsync 3386 259e - 3387 259e -oddframevsync 3388 259e - sta WSYNC 3389 259e - 3390 259e - LDA ($80,X) ; 11 waste 3391 259e - LDA ($80,X) ; 11 waste 3392 259e - LDA ($80,X) ; 11 waste 3393 259e - 3394 259e - lda #2 3395 259e - sta VSYNC 3396 259e - sta WSYNC 3397 259e - sta WSYNC 3398 259e - sta WSYNC 3399 259e - 3400 259e - LDA ($80,X) ; 11 waste 3401 259e - LDA ($80,X) ; 11 waste 3402 259e - LDA ($80,X) ; 11 waste 3403 259e - 3404 259e - lda #0 3405 259e - sta VSYNC 3406 259e - sta VBLANK 3407 259e - ifnconst overscan_time 3408 259e - lda #37+128 3409 259e - else 3410 259e - lda #overscan_time+128 3411 259e - endif 3412 259e - sta TIM64T 3413 259e - 3414 259e -postsync 3415 259e endif 3416 259e 3417 259e - ifconst legacy 3418 259e - if legacy < 100 3419 259e - ldx #4 3420 259e -adjustloop 3421 259e - lda player0x,x 3422 259e - sec 3423 259e - sbc #14 ;? 3424 259e - sta player0x,x 3425 259e - dex 3426 259e - bpl adjustloop 3427 259e - endif 3428 259e endif 3429 259e - if ((<*)>$e9)&&((<*)<$fa) 3430 259e - repeat ($fa-(<*)) 3431 259e - nop 3432 259e - repend 3433 259e endif 3434 259e 85 02 sta WSYNC 3435 25a0 a2 04 ldx #4 0 25a2 SLEEP 3 1 25a2 .CYCLES SET 3 2 25a2 3 25a2 - IF .CYCLES < 2 4 25a2 - ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 5 25a2 - ERR 6 25a2 ENDIF 7 25a2 8 25a2 IF .CYCLES & 1 9 25a2 IFNCONST NO_ILLEGAL_OPCODES 10 25a2 04 00 nop 0 11 25a4 - ELSE 12 25a4 - bit VSYNC 13 25a4 ENDIF 14 25a4 .CYCLES SET .CYCLES - 3 15 25a4 ENDIF 16 25a4 17 25a4 - REPEAT .CYCLES / 2 18 25a4 - nop 19 25a4 REPEND 3437 25a4 HorPosLoop ; 5 3438 25a4 b5 80 lda player0x,X ;+4 9 3439 25a6 38 sec ;+2 11 3440 25a7 DivideLoop 3441 25a7 e9 0f sbc #15 3442 25a9 b0 fc bcs DivideLoop ;+4 15 3443 25ab 95 9c sta temp1,X ;+4 19 3444 25ad 95 10 sta RESP0,X ;+4 23 3445 25af 85 02 sta WSYNC 3446 25b1 ca dex 3447 25b2 10 f0 bpl HorPosLoop ;+5 5 3448 25b4 ; 4 3449 25b4 3450 25b4 a2 04 ldx #4 3451 25b6 b4 9c ldy temp1,X 3452 25b8 b9 14 f5 lda repostable-256,Y 3453 25bb 95 20 sta HMP0,X ;+14 18 3454 25bd 3455 25bd ca dex 3456 25be b4 9c ldy temp1,X 3457 25c0 b9 14 f5 lda repostable-256,Y 3458 25c3 95 20 sta HMP0,X ;+14 32 3459 25c5 3460 25c5 ca dex 3461 25c6 b4 9c ldy temp1,X 3462 25c8 b9 14 f5 lda repostable-256,Y 3463 25cb 95 20 sta HMP0,X ;+14 46 3464 25cd 3465 25cd ca dex 3466 25ce b4 9c ldy temp1,X 3467 25d0 b9 14 f5 lda repostable-256,Y 3468 25d3 95 20 sta HMP0,X ;+14 60 3469 25d5 3470 25d5 ca dex 3471 25d6 b4 9c ldy temp1,X 3472 25d8 b9 14 f5 lda repostable-256,Y 3473 25db 95 20 sta HMP0,X ;+14 74 3474 25dd 3475 25dd 85 02 sta WSYNC 3476 25df 3477 25df 85 2a sta HMOVE ;+3 3 3478 25e1 3479 25e1 3480 25e1 - ifconst legacy 3481 25e1 - if legacy < 100 3482 25e1 - ldx #4 3483 25e1 -adjustloop2 3484 25e1 - lda player0x,x 3485 25e1 - clc 3486 25e1 - adc #14 ;? 3487 25e1 - sta player0x,x 3488 25e1 - dex 3489 25e1 - bpl adjustloop2 3490 25e1 - endif 3491 25e1 endif 3492 25e1 3493 25e1 3494 25e1 3495 25e1 3496 25e1 ;set score pointers 3497 25e1 a7 95 lax score+2 3498 25e3 20 14 f6 jsr scorepointerset 3499 25e6 84 9b sty scorepointers+5 3500 25e8 86 98 stx scorepointers+2 3501 25ea a7 94 lax score+1 3502 25ec 20 14 f6 jsr scorepointerset 3503 25ef 84 9a sty scorepointers+4 3504 25f1 86 97 stx scorepointers+1 3505 25f3 a7 93 lax score 3506 25f5 20 14 f6 jsr scorepointerset 3507 25f8 84 99 sty scorepointers+3 3508 25fa 86 96 stx scorepointers 3509 25fc 3510 25fc vblk 3511 25fc ; run possible vblank bB code 3512 25fc - ifconst vblank_bB_code 3513 25fc - jsr vblank_bB_code 3514 25fc endif 3515 25fc vblk2 3516 25fc ad 84 02 LDA INTIM 3517 25ff 30 fb bmi vblk2 3518 2601 4c 00 f1 jmp kernel 3519 2604 3520 2604 3521 2604 80 70 60 50* .byte.b $80,$70,$60,$50,$40,$30,$20,$10,$00 3522 260d f0 e0 d0 c0* .byte.b $F0,$E0,$D0,$C0,$B0,$A0,$90 3523 2614 repostable 3524 2614 3525 2614 scorepointerset 3526 2614 29 0f and #$0F 3527 2616 0a asl 3528 2617 0a asl 3529 2618 0a asl 3530 2619 69 74 adc # (<(*+7)) 3542 2623 - repeat ($100-<*) 3543 2623 - .byte 0 3544 2623 - repend 3545 2623 endif 3546 2623 player23then_1 3547 2623 80 .byte.b %10000000 3548 2624 80 .byte.b %10000000 3549 2625 80 .byte.b %10000000 3550 2626 e0 .byte.b %11100000 3551 2627 fc .byte.b %11111100 3552 2628 ff .byte.b %11111111 3553 2629 fc .byte.b %11111100 3554 262a e0 .byte.b %11100000 3555 262b - if (<*) > (<(*+8)) 3556 262b - repeat ($100-<*) 3557 262b - .byte 0 3558 262b - repend 3559 262b endif 3560 262b playercolor24then_1 3561 262b 00 .byte.b $00 3562 262c 00 .byte.b $00 3563 262d 00 .byte.b $00 3564 262e 57 .byte.b $57 3565 262f 57 .byte.b $57 3566 2630 57 .byte.b $57 3567 2631 57 .byte.b $57 3568 2632 57 .byte.b $57 3569 2633 57 .byte.b $57 3570 2634 - if (<*) > (<(*+10)) 3571 2634 - repeat ($100-<*) 3572 2634 - .byte 0 3573 2634 - repend 3574 2634 endif 3575 2634 playercolor25then_1 3576 2634 c4 .byte.b $C4 3577 2635 44 .byte.b $44 3578 2636 2c .byte.b $2C 3579 2637 2c .byte.b $2C 3580 2638 44 .byte.b $44 3581 2639 2c .byte.b $2C 3582 263a 2c .byte.b $2C 3583 263b 2c .byte.b $2C 3584 263c 2c .byte.b $2C 3585 263d 2c .byte.b $2C 3586 263e 44 .byte.b $44 3587 263f - if (<*) > (<(*+10)) 3588 263f - repeat ($100-<*) 3589 263f - .byte 0 3590 263f - repend 3591 263f endif 3592 263f player26then_1 3593 263f ff .byte.b %11111111 3594 2640 a5 .byte.b %10100101 3595 2641 a5 .byte.b %10100101 3596 2642 00 .byte.b %00000000 3597 2643 3c .byte.b %00111100 3598 2644 5a .byte.b %01011010 3599 2645 d3 .byte.b %11010011 3600 2646 db .byte.b %11011011 3601 2647 d3 .byte.b %11010011 3602 2648 5a .byte.b %01011010 3603 2649 3c .byte.b %00111100 3604 264a - if (<*) > (<(*+10)) 3605 264a - repeat ($100-<*) 3606 264a - .byte 0 3607 264a - repend 3608 264a endif 3609 264a player28then_0 3610 264a 00 .byte.b %00000000 3611 264b bd .byte.b %10111101 3612 264c e7 .byte.b %11100111 3613 264d a5 .byte.b %10100101 3614 264e 24 .byte.b %00100100 3615 264f 3c .byte.b %00111100 3616 2650 18 .byte.b %00011000 3617 2651 db .byte.b %11011011 3618 2652 ff .byte.b %11111111 3619 2653 c3 .byte.b %11000011 3620 2654 00 .byte.b %00000000 3621 2655 - if (<*) > (<(*+10)) 3622 2655 - repeat ($100-<*) 3623 2655 - .byte 0 3624 2655 - repend 3625 2655 endif 3626 2655 player30then_0 3627 2655 00 .byte.b %00000000 3628 2656 bd .byte.b %10111101 3629 2657 e7 .byte.b %11100111 3630 2658 a5 .byte.b %10100101 3631 2659 24 .byte.b %00100100 3632 265a 3c .byte.b %00111100 3633 265b 18 .byte.b %00011000 3634 265c db .byte.b %11011011 3635 265d 3c .byte.b %00111100 3636 265e c3 .byte.b %11000011 3637 265f 00 .byte.b %00000000 3638 2660 - if (<*) > (<(*+7)) 3639 2660 - repeat ($100-<*) 3640 2660 - .byte 0 3641 2660 - repend 3642 2660 endif 3643 2660 playerL0148_0 3644 2660 80 .byte.b %10000000 3645 2661 80 .byte.b %10000000 3646 2662 80 .byte.b %10000000 3647 2663 e0 .byte.b %11100000 3648 2664 fc .byte.b %11111100 3649 2665 ff .byte.b %11111111 3650 2666 fc .byte.b %11111100 3651 2667 e0 .byte.b %11100000 3652 2668 - if (<*) > (<(*+5)) 3653 2668 - repeat ($100-<*) 3654 2668 - .byte 0 3655 2668 - repend 3656 2668 endif 3657 2668 player34then_1 3658 2668 0e .byte.b %00001110 3659 2669 0a .byte.b %00001010 3660 266a 0a .byte.b %00001010 3661 266b 0a .byte.b %00001010 3662 266c 0e .byte.b %00001110 3663 266d 00 .byte.b %00000000 3664 266e - if (<*) > (<(*+5)) 3665 266e - repeat ($100-<*) 3666 266e - .byte 0 3667 266e - repend 3668 266e endif 3669 266e player35then_1 3670 266e 0e .byte.b %00001110 3671 266f 04 .byte.b %00000100 3672 2670 04 .byte.b %00000100 3673 2671 0c .byte.b %00001100 3674 2672 04 .byte.b %00000100 3675 2673 00 .byte.b %00000000 3676 2674 - if (<*) > (<(*+5)) 3677 2674 - repeat ($100-<*) 3678 2674 - .byte 0 3679 2674 - repend 3680 2674 endif 3681 2674 player36then_1 3682 2674 0e .byte.b %00001110 3683 2675 08 .byte.b %00001000 3684 2676 0e .byte.b %00001110 3685 2677 02 .byte.b %00000010 3686 2678 0e .byte.b %00001110 3687 2679 00 .byte.b %00000000 3688 267a - if (<*) > (<(*+5)) 3689 267a - repeat ($100-<*) 3690 267a - .byte 0 3691 267a - repend 3692 267a endif 3693 267a player37then_1 3694 267a 0e .byte.b %00001110 3695 267b 02 .byte.b %00000010 3696 267c 06 .byte.b %00000110 3697 267d 02 .byte.b %00000010 3698 267e 0e .byte.b %00001110 3699 267f 00 .byte.b %00000000 3700 2680 - if (<*) > (<(*+5)) 3701 2680 - repeat ($100-<*) 3702 2680 - .byte 0 3703 2680 - repend 3704 2680 endif 3705 2680 player38then_1 3706 2680 02 .byte.b %00000010 3707 2681 02 .byte.b %00000010 3708 2682 0e .byte.b %00001110 3709 2683 0a .byte.b %00001010 3710 2684 0a .byte.b %00001010 3711 2685 00 .byte.b %00000000 3712 2686 - if (<*) > (<(*+5)) 3713 2686 - repeat ($100-<*) 3714 2686 - .byte 0 3715 2686 - repend 3716 2686 endif 3717 2686 player39then_1 3718 2686 0e .byte.b %00001110 3719 2687 02 .byte.b %00000010 3720 2688 0e .byte.b %00001110 3721 2689 08 .byte.b %00001000 3722 268a 0e .byte.b %00001110 3723 268b 00 .byte.b %00000000 3724 268c - if (<*) > (<(*+5)) 3725 268c - repeat ($100-<*) 3726 268c - .byte 0 3727 268c - repend 3728 268c endif 3729 268c player40then_1 3730 268c 0e .byte.b %00001110 3731 268d 0a .byte.b %00001010 3732 268e 0e .byte.b %00001110 3733 268f 08 .byte.b %00001000 3734 2690 0e .byte.b %00001110 3735 2691 00 .byte.b %00000000 3736 2692 - if (<*) > (<(*+5)) 3737 2692 - repeat ($100-<*) 3738 2692 - .byte 0 3739 2692 - repend 3740 2692 endif 3741 2692 player41then_1 3742 2692 02 .byte.b %00000010 3743 2693 02 .byte.b %00000010 3744 2694 02 .byte.b %00000010 3745 2695 02 .byte.b %00000010 3746 2696 0e .byte.b %00001110 3747 2697 00 .byte.b %00000000 3748 2698 - if (<*) > (<(*+5)) 3749 2698 - repeat ($100-<*) 3750 2698 - .byte 0 3751 2698 - repend 3752 2698 endif 3753 2698 player42then_1 3754 2698 0e .byte.b %00001110 3755 2699 0a .byte.b %00001010 3756 269a 0e .byte.b %00001110 3757 269b 0a .byte.b %00001010 3758 269c 0e .byte.b %00001110 3759 269d 00 .byte.b %00000000 3760 269e - if (<*) > (<(*+5)) 3761 269e - repeat ($100-<*) 3762 269e - .byte 0 3763 269e - repend 3764 269e endif 3765 269e player43then_1 3766 269e 02 .byte.b %00000010 3767 269f 02 .byte.b %00000010 3768 26a0 0e .byte.b %00001110 3769 26a1 0a .byte.b %00001010 3770 26a2 0e .byte.b %00001110 3771 26a3 00 .byte.b %00000000 3772 26a4 - if (<*) > (<(*+5)) 3773 26a4 - repeat ($100-<*) 3774 26a4 - .byte 0 3775 26a4 - repend 3776 26a4 endif 3777 26a4 player44then_1 3778 26a4 ee .byte.b %11101110 3779 26a5 4a .byte.b %01001010 3780 26a6 4a .byte.b %01001010 3781 26a7 ca .byte.b %11001010 3782 26a8 4e .byte.b %01001110 3783 26a9 00 .byte.b %00000000 3784 26aa - if (<*) > (<(*+5)) 3785 26aa - repeat ($100-<*) 3786 26aa - .byte 0 3787 26aa - repend 3788 26aa endif 3789 26aa player45then_1 3790 26aa ee .byte.b %11101110 3791 26ab 44 .byte.b %01000100 3792 26ac 44 .byte.b %01000100 3793 26ad cc .byte.b %11001100 3794 26ae 44 .byte.b %01000100 3795 26af 00 .byte.b %00000000 3796 26b0 - if (<*) > (<(*+5)) 3797 26b0 - repeat ($100-<*) 3798 26b0 - .byte 0 3799 26b0 - repend 3800 26b0 endif 3801 26b0 player46then_1 3802 26b0 ee .byte.b %11101110 3803 26b1 48 .byte.b %01001000 3804 26b2 4e .byte.b %01001110 3805 26b3 c2 .byte.b %11000010 3806 26b4 4e .byte.b %01001110 3807 26b5 00 .byte.b %00000000 3808 26b6 - if (<*) > (<(*+5)) 3809 26b6 - repeat ($100-<*) 3810 26b6 - .byte 0 3811 26b6 - repend 3812 26b6 endif 3813 26b6 player47then_1 3814 26b6 ee .byte.b %11101110 3815 26b7 42 .byte.b %01000010 3816 26b8 46 .byte.b %01000110 3817 26b9 c2 .byte.b %11000010 3818 26ba 4e .byte.b %01001110 3819 26bb 00 .byte.b %00000000 3820 26bc - if (<*) > (<(*+5)) 3821 26bc - repeat ($100-<*) 3822 26bc - .byte 0 3823 26bc - repend 3824 26bc endif 3825 26bc player48then_1 3826 26bc e2 .byte.b %11100010 3827 26bd 42 .byte.b %01000010 3828 26be 4e .byte.b %01001110 3829 26bf ca .byte.b %11001010 3830 26c0 4a .byte.b %01001010 3831 26c1 00 .byte.b %00000000 3832 26c2 - if (<*) > (<(*+5)) 3833 26c2 - repeat ($100-<*) 3834 26c2 - .byte 0 3835 26c2 - repend 3836 26c2 endif 3837 26c2 player49then_1 3838 26c2 ee .byte.b %11101110 3839 26c3 42 .byte.b %01000010 3840 26c4 4e .byte.b %01001110 3841 26c5 c8 .byte.b %11001000 3842 26c6 4e .byte.b %01001110 3843 26c7 00 .byte.b %00000000 3844 26c8 - if (<*) > (<(*+5)) 3845 26c8 - repeat ($100-<*) 3846 26c8 - .byte 0 3847 26c8 - repend 3848 26c8 endif 3849 26c8 player50then_1 3850 26c8 ee .byte.b %11101110 3851 26c9 4a .byte.b %01001010 3852 26ca 4e .byte.b %01001110 3853 26cb c8 .byte.b %11001000 3854 26cc 4e .byte.b %01001110 3855 26cd 00 .byte.b %00000000 3856 26ce - if (<*) > (<(*+5)) 3857 26ce - repeat ($100-<*) 3858 26ce - .byte 0 3859 26ce - repend 3860 26ce endif 3861 26ce player51then_1 3862 26ce e2 .byte.b %11100010 3863 26cf 42 .byte.b %01000010 3864 26d0 42 .byte.b %01000010 3865 26d1 c2 .byte.b %11000010 3866 26d2 4e .byte.b %01001110 3867 26d3 00 .byte.b %00000000 3868 26d4 - if (<*) > (<(*+5)) 3869 26d4 - repeat ($100-<*) 3870 26d4 - .byte 0 3871 26d4 - repend 3872 26d4 endif 3873 26d4 player52then_1 3874 26d4 ee .byte.b %11101110 3875 26d5 4a .byte.b %01001010 3876 26d6 4e .byte.b %01001110 3877 26d7 ca .byte.b %11001010 3878 26d8 4e .byte.b %01001110 3879 26d9 00 .byte.b %00000000 3880 26da - if (<*) > (<(*+5)) 3881 26da - repeat ($100-<*) 3882 26da - .byte 0 3883 26da - repend 3884 26da endif 3885 26da player53then_1 3886 26da e2 .byte.b %11100010 3887 26db 42 .byte.b %01000010 3888 26dc 4e .byte.b %01001110 3889 26dd ca .byte.b %11001010 3890 26de 4e .byte.b %01001110 3891 26df 00 .byte.b %00000000 3892 26e0 - if (<*) > (<(*+5)) 3893 26e0 - repeat ($100-<*) 3894 26e0 - .byte 0 3895 26e0 - repend 3896 26e0 endif 3897 26e0 player54then_1 3898 26e0 ee .byte.b %11101110 3899 26e1 8a .byte.b %10001010 3900 26e2 ea .byte.b %11101010 3901 26e3 2a .byte.b %00101010 3902 26e4 ee .byte.b %11101110 3903 26e5 00 .byte.b %00000000 3904 26e6 - if (<*) > (<(*+5)) 3905 26e6 - repeat ($100-<*) 3906 26e6 - .byte 0 3907 26e6 - repend 3908 26e6 endif 3909 26e6 player55then_1 3910 26e6 ee .byte.b %11101110 3911 26e7 84 .byte.b %10000100 3912 26e8 e4 .byte.b %11100100 3913 26e9 2c .byte.b %00101100 3914 26ea e4 .byte.b %11100100 3915 26eb 00 .byte.b %00000000 3916 26ec - if (<*) > (<(*+5)) 3917 26ec - repeat ($100-<*) 3918 26ec - .byte 0 3919 26ec - repend 3920 26ec endif 3921 26ec player56then_1 3922 26ec ee .byte.b %11101110 3923 26ed 88 .byte.b %10001000 3924 26ee ee .byte.b %11101110 3925 26ef 22 .byte.b %00100010 3926 26f0 ee .byte.b %11101110 3927 26f1 00 .byte.b %00000000 3928 26f2 - if (<*) > (<(*+5)) 3929 26f2 - repeat ($100-<*) 3930 26f2 - .byte 0 3931 26f2 - repend 3932 26f2 endif 3933 26f2 player57then_1 3934 26f2 ee .byte.b %11101110 3935 26f3 82 .byte.b %10000010 3936 26f4 e6 .byte.b %11100110 3937 26f5 22 .byte.b %00100010 3938 26f6 ee .byte.b %11101110 3939 26f7 00 .byte.b %00000000 3940 26f8 - if (<*) > (<(*+5)) 3941 26f8 - repeat ($100-<*) 3942 26f8 - .byte 0 3943 26f8 - repend 3944 26f8 endif 3945 26f8 player58then_1 3946 26f8 e2 .byte.b %11100010 3947 26f9 82 .byte.b %10000010 3948 26fa ee .byte.b %11101110 3949 26fb 2a .byte.b %00101010 3950 26fc ea .byte.b %11101010 3951 26fd 00 .byte.b %00000000 3952 26fe if (<*) > (<(*+5)) 3953 26fe repeat ($100-<*) 3954 26fe 00 .byte.b 0 3953 26fe repend 3954 26ff 00 .byte.b 0 3955 2700 repend 3956 2700 endif 3957 2700 player59then_1 3958 2700 ee .byte.b %11101110 3959 2701 82 .byte.b %10000010 3960 2702 ee .byte.b %11101110 3961 2703 28 .byte.b %00101000 3962 2704 ee .byte.b %11101110 3963 2705 00 .byte.b %00000000 3964 2706 - if (<*) > (<(*+4)) 3965 2706 - repeat ($100-<*) 3966 2706 - .byte 0 3967 2706 - repend 3968 2706 endif 3969 2706 player60then_1 3970 2706 ee .byte.b %11101110 3971 2707 8a .byte.b %10001010 3972 2708 ee .byte.b %11101110 3973 2709 28 .byte.b %00101000 3974 270a ee .byte.b %11101110 3975 270b - if (<*) > (<(*+5)) 3976 270b - repeat ($100-<*) 3977 270b - .byte 0 3978 270b - repend 3979 270b endif 3980 270b player61then_1 3981 270b e2 .byte.b %11100010 3982 270c 82 .byte.b %10000010 3983 270d e2 .byte.b %11100010 3984 270e 22 .byte.b %00100010 3985 270f ee .byte.b %11101110 3986 2710 00 .byte.b %00000000 3987 2711 - if (<*) > (<(*+5)) 3988 2711 - repeat ($100-<*) 3989 2711 - .byte 0 3990 2711 - repend 3991 2711 endif 3992 2711 player62then_1 3993 2711 ee .byte.b %11101110 3994 2712 8a .byte.b %10001010 3995 2713 ee .byte.b %11101110 3996 2714 2a .byte.b %00101010 3997 2715 ee .byte.b %11101110 3998 2716 00 .byte.b %00000000 3999 2717 - if (<*) > (<(*+5)) 4000 2717 - repeat ($100-<*) 4001 2717 - .byte 0 4002 2717 - repend 4003 2717 endif 4004 2717 player63then_1 4005 2717 e2 .byte.b %11100010 4006 2718 82 .byte.b %10000010 4007 2719 ee .byte.b %11101110 4008 271a 2a .byte.b %00101010 4009 271b ee .byte.b %11101110 4010 271c 00 .byte.b %00000000 4011 271d - if (<*) > (<(*+5)) 4012 271d - repeat ($100-<*) 4013 271d - .byte 0 4014 271d - repend 4015 271d endif 4016 271d player64then_1 4017 271d ee .byte.b %11101110 4018 271e 2a .byte.b %00101010 4019 271f 6a .byte.b %01101010 4020 2720 2a .byte.b %00101010 4021 2721 ee .byte.b %11101110 4022 2722 00 .byte.b %00000000 4023 2723 - if (<*) > (<(*+4)) 4024 2723 - repeat ($100-<*) 4025 2723 - .byte 0 4026 2723 - repend 4027 2723 endif 4028 2723 player65then_1 4029 2723 ee .byte.b %11101110 4030 2724 24 .byte.b %00100100 4031 2725 64 .byte.b %01100100 4032 2726 2c .byte.b %00101100 4033 2727 e4 .byte.b %11100100 4034 2728 if ECHOFIRST 2124 bytes of ROM space left in bank 2 4035 2728 echo " ",[(scoretable - *)]d , "bytes of ROM space left in bank 2") 4036 2728 endif 4037 2728 00 01 ECHOFIRST = 1 4038 2728 4039 2728 4040 2728 ; feel free to modify the score graphics - just keep each digit 8 high 4041 2728 ; and keep the conditional compilation stuff intact 4042 2728 - ifconst ROM2k 4043 2728 - ORG $F7AC-8 4044 2728 else 4045 2728 ifconst bankswitch 4046 2728 if bankswitch == 8 4047 2f74 ORG $2F94-bscode_length 4048 2f74 RORG $FF94-bscode_length 4049 2f74 endif 4050 2f74 - if bankswitch == 16 4051 2f74 - ORG $4F94-bscode_length 4052 2f74 - RORG $FF94-bscode_length 4053 2f74 endif 4054 2f74 - if bankswitch == 32 4055 2f74 - ORG $8F94-bscode_length 4056 2f74 - RORG $FF94-bscode_length 4057 2f74 endif 4058 2f74 - if bankswitch == 64 4059 2f74 - ORG $10F80-bscode_length 4060 2f74 - RORG $1FF80-bscode_length 4061 2f74 endif 4062 2f74 - else 4063 2f74 - ORG $FF9C 4064 2f74 endif 4065 2f74 endif 4066 2f74 4067 2f74 ; font equates 4068 2f74 00 01 .21stcentury = 1 4069 2f74 00 02 alarmclock = 2 4070 2f74 00 03 handwritten = 3 4071 2f74 00 04 interrupted = 4 4072 2f74 00 05 retroputer = 5 4073 2f74 00 06 whimsey = 6 4074 2f74 00 07 tiny = 7 4075 2f74 4076 2f74 scoretable 4077 2f74 4078 2f74 - ifconst font 4079 2f74 - if font == .21stcentury 4080 2f74 - include "score_graphics.asm.21stcentury" 4081 2f74 - endif 4082 2f74 - if font == alarmclock 4083 2f74 - include "score_graphics.asm.alarmclock" 4084 2f74 - endif 4085 2f74 - if font == handwritten 4086 2f74 - include "score_graphics.asm.handwritten" 4087 2f74 - endif 4088 2f74 - if font == interrupted 4089 2f74 - include "score_graphics.asm.interrupted" 4090 2f74 - endif 4091 2f74 - if font == retroputer 4092 2f74 - include "score_graphics.asm.retroputer" 4093 2f74 - endif 4094 2f74 - if font == whimsey 4095 2f74 - include "score_graphics.asm.whimsey" 4096 2f74 - endif 4097 2f74 - if font == tiny 4098 2f74 - include "score_graphics.asm.tiny" 4099 2f74 - endif 4100 2f74 else ; default font 4101 2f74 4102 2f74 3c .byte.b %00111100 4103 2f75 66 .byte.b %01100110 4104 2f76 66 .byte.b %01100110 4105 2f77 66 .byte.b %01100110 4106 2f78 66 .byte.b %01100110 4107 2f79 66 .byte.b %01100110 4108 2f7a 66 .byte.b %01100110 4109 2f7b 3c .byte.b %00111100 4110 2f7c 4111 2f7c 7e .byte.b %01111110 4112 2f7d 18 .byte.b %00011000 4113 2f7e 18 .byte.b %00011000 4114 2f7f 18 .byte.b %00011000 4115 2f80 18 .byte.b %00011000 4116 2f81 38 .byte.b %00111000 4117 2f82 18 .byte.b %00011000 4118 2f83 08 .byte.b %00001000 4119 2f84 4120 2f84 7e .byte.b %01111110 4121 2f85 60 .byte.b %01100000 4122 2f86 60 .byte.b %01100000 4123 2f87 3c .byte.b %00111100 4124 2f88 06 .byte.b %00000110 4125 2f89 06 .byte.b %00000110 4126 2f8a 46 .byte.b %01000110 4127 2f8b 3c .byte.b %00111100 4128 2f8c 4129 2f8c 3c .byte.b %00111100 4130 2f8d 46 .byte.b %01000110 4131 2f8e 06 .byte.b %00000110 4132 2f8f 06 .byte.b %00000110 4133 2f90 1c .byte.b %00011100 4134 2f91 06 .byte.b %00000110 4135 2f92 46 .byte.b %01000110 4136 2f93 3c .byte.b %00111100 4137 2f94 4138 2f94 0c .byte.b %00001100 4139 2f95 0c .byte.b %00001100 4140 2f96 7e .byte.b %01111110 4141 2f97 4c .byte.b %01001100 4142 2f98 4c .byte.b %01001100 4143 2f99 2c .byte.b %00101100 4144 2f9a 1c .byte.b %00011100 4145 2f9b 0c .byte.b %00001100 4146 2f9c 4147 2f9c 3c .byte.b %00111100 4148 2f9d 46 .byte.b %01000110 4149 2f9e 06 .byte.b %00000110 4150 2f9f 06 .byte.b %00000110 4151 2fa0 3c .byte.b %00111100 4152 2fa1 60 .byte.b %01100000 4153 2fa2 60 .byte.b %01100000 4154 2fa3 7e .byte.b %01111110 4155 2fa4 4156 2fa4 3c .byte.b %00111100 4157 2fa5 66 .byte.b %01100110 4158 2fa6 66 .byte.b %01100110 4159 2fa7 66 .byte.b %01100110 4160 2fa8 7c .byte.b %01111100 4161 2fa9 60 .byte.b %01100000 4162 2faa 62 .byte.b %01100010 4163 2fab 3c .byte.b %00111100 4164 2fac 4165 2fac 30 .byte.b %00110000 4166 2fad 30 .byte.b %00110000 4167 2fae 30 .byte.b %00110000 4168 2faf 18 .byte.b %00011000 4169 2fb0 0c .byte.b %00001100 4170 2fb1 06 .byte.b %00000110 4171 2fb2 42 .byte.b %01000010 4172 2fb3 3e .byte.b %00111110 4173 2fb4 4174 2fb4 3c .byte.b %00111100 4175 2fb5 66 .byte.b %01100110 4176 2fb6 66 .byte.b %01100110 4177 2fb7 66 .byte.b %01100110 4178 2fb8 3c .byte.b %00111100 4179 2fb9 66 .byte.b %01100110 4180 2fba 66 .byte.b %01100110 4181 2fbb 3c .byte.b %00111100 4182 2fbc 4183 2fbc 3c .byte.b %00111100 4184 2fbd 46 .byte.b %01000110 4185 2fbe 06 .byte.b %00000110 4186 2fbf 3e .byte.b %00111110 4187 2fc0 66 .byte.b %01100110 4188 2fc1 66 .byte.b %01100110 4189 2fc2 66 .byte.b %01100110 4190 2fc3 3c .byte.b %00111100 4191 2fc4 4192 2fc4 ifnconst DPC_kernel_options 4193 2fc4 4194 2fc4 00 .byte.b %00000000 4195 2fc5 00 .byte.b %00000000 4196 2fc6 00 .byte.b %00000000 4197 2fc7 00 .byte.b %00000000 4198 2fc8 00 .byte.b %00000000 4199 2fc9 00 .byte.b %00000000 4200 2fca 00 .byte.b %00000000 4201 2fcb 00 .byte.b %00000000 4202 2fcc 4203 2fcc endif 4204 2fcc 4205 2fcc endif 4206 2fcc 4207 2fcc - ifconst ROM2k 4208 2fcc - ORG $F7FC 4209 2fcc else 4210 2fcc ifconst bankswitch 4211 2fcc if bankswitch == 8 4212 2fd4 ORG $2FF4-bscode_length 4213 2fd4 RORG $FFF4-bscode_length 4214 2fd4 endif 4215 2fd4 - if bankswitch == 16 4216 2fd4 - ORG $4FF4-bscode_length 4217 2fd4 - RORG $FFF4-bscode_length 4218 2fd4 endif 4219 2fd4 - if bankswitch == 32 4220 2fd4 - ORG $8FF4-bscode_length 4221 2fd4 - RORG $FFF4-bscode_length 4222 2fd4 endif 4223 2fd4 - if bankswitch == 64 4224 2fd4 - ORG $10FE0-bscode_length 4225 2fd4 - RORG $1FFE0-bscode_length 4226 2fd4 endif 4227 2fd4 - else 4228 2fd4 - ORG $FFFC 4229 2fd4 endif 4230 2fd4 endif 4231 2fd4 ; every bank has this stuff at the same place 4232 2fd4 ; this code can switch to/from any bank at any entry point 4233 2fd4 ; and can preserve register values 4234 2fd4 ; note: lines not starting with a space are not placed in all banks 4235 2fd4 ; 4236 2fd4 ; line below tells the compiler how long this is - do not remove 4237 2fd4 ;size=32 4238 2fd4 4239 2fd4 begin_bscode 4240 2fd4 a2 ff ldx #$ff 4241 2fd6 - ifconst FASTFETCH ; using DPC+ 4242 2fd6 - stx FASTFETCH 4243 2fd6 endif 4244 2fd6 9a txs 4245 2fd7 - if bankswitch == 64 4246 2fd7 - lda #(((>(start-1)) & $0F) | $F0) 4247 2fd7 else 4248 2fd7 a9 f3 lda #>(start-1) 4249 2fd9 endif 4250 2fd9 48 pha 4251 2fda a9 51 lda #<(start-1) 4252 2fdc 48 pha 4253 2fdd 4254 2fdd BS_return 4255 2fdd 48 pha 4256 2fde 8a txa 4257 2fdf 48 pha 4258 2fe0 ba tsx 4259 2fe1 4260 2fe1 if bankswitch != 64 4261 2fe1 b5 04 lda 4,x ; get high byte of return address 4262 2fe3 4263 2fe3 2a rol 4264 2fe4 2a rol 4265 2fe5 2a rol 4266 2fe6 2a rol 4267 2fe7 29 01 and #bs_mask ;1 3 or 7 for F8/F6/F4 4268 2fe9 aa tax 4269 2fea e8 inx 4270 2feb - else 4271 2feb - lda 4,x ; get high byte of return address 4272 2feb - tay 4273 2feb - ora #$10 ; change our bank nibble into a valid rom mirror 4274 2feb - sta 4,x 4275 2feb - tya 4276 2feb - lsr 4277 2feb - lsr 4278 2feb - lsr 4279 2feb - lsr 4280 2feb - tax 4281 2feb - inx 4282 2feb endif 4283 2feb 4284 2feb BS_jsr 4285 2feb bd f7 1f lda bankswitch_hotspot-1,x 4286 2fee 68 pla 4287 2fef aa tax 4288 2ff0 68 pla 4289 2ff1 60 rts 4290 2ff2 - if ((* & $1FFF) > ((bankswitch_hotspot & $1FFF) - 1)) 4291 2ff2 - echo "WARNING: size parameter in banksw.asm too small - the program probably will not work." 4292 2ff2 - echo "Change to",[(*-begin_bscode+1)&$FF]d,"and try again." 4293 2ff2 endif 4294 2ff2 ifconst bankswitch 4295 2ff2 if bankswitch == 8 4296 2ffc ORG $2FFC 4297 2ffc RORG $FFFC 4298 2ffc endif 4299 2ffc - if bankswitch == 16 4300 2ffc - ORG $4FFC 4301 2ffc - RORG $FFFC 4302 2ffc endif 4303 2ffc - if bankswitch == 32 4304 2ffc - ORG $8FFC 4305 2ffc - RORG $FFFC 4306 2ffc endif 4307 2ffc - if bankswitch == 64 4308 2ffc - ORG $10FF0 4309 2ffc - RORG $1FFF0 4310 2ffc - lda $ffe0 ; we use wasted space to assist stella with EF format auto-detection 4311 2ffc - ORG $10FF8 4312 2ffc - RORG $1FFF8 4313 2ffc - ifconst superchip 4314 2ffc - .byte "E","F","S","C" 4315 2ffc - else 4316 2ffc - .byte "E","F","E","F" 4317 2ffc - endif 4318 2ffc - ORG $10FFC 4319 2ffc - RORG $1FFFC 4320 2ffc endif 4321 2ffc - else 4322 2ffc - ifconst ROM2k 4323 2ffc - ORG $F7FC 4324 2ffc - else 4325 2ffc - ORG $FFFC 4326 2ffc - endif 4327 2ffc endif 4328 2ffc 52 f3 .word.w start 4329 2ffe 52 f3 .word.w start