Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
; jeżeli zbliżasz się do końca pętli zniweluj teren
ROW=NEXTROW
IF LMS>STARTSCREEN+LOOP-$30 THEN
IF ROW>0 THEN
NEXTROW==-1
DRAWROW=RSLOPE DRAWNEXTROW=RFILL
RET
ELSE
DRAWROW=GLADE RET
FI
FI
;-----------------------------------------------
PROC DRAWLINE=*()
SETBLOCK(STARTSCREEN+STARTROW+$120,$30,GLADE)
RET
;-----------------------------------------------
IF LMS=STARTSCREEN+LOOP+4 THEN
DRAWLINE()
NEXTROW=0 SCREENI=STARTROW LMS=STARTSCREEN
ELSE
Vertical Blank Interrupts:
The vectors are called Immediate VBlank and Deferred VBlank. Atari engineers split the Vertical Blank period into two separate sections because a VBI can extend for about 20,000 cycles or nearly all the time available before the next VBI. The Immediate VBlank portion refers to the time critical period when the electron beam is actually offscreen. It is here that shadowing and hardware registers are updated. Once the OS VBI routine has completed its housekeeping chores, it jumps through the Deferred VBlank vector, which is set by the OS to point to a routine that will restore the registers and return the computer to its position before the interrupt. The OS VBI routine will abort if the computer was in the middle of a time critical I/0 routine such as sending data to a cassette or disk drive. In such a case, the Deferred VBlank vector is bypassed. Unless you are using disk 1/0 where your code must be short enough not to delay shadowing updating, you can use Deferred VBlank without being concerned.Display List Interrupts:
Display list interrupts are generally used to change the color registers midscreen or switch character sets in use. These changes can be made very rapidly since they are short and usually modify only a few bytes. Take care so that changes of this type are offscreen during Horizontal Blank, or they will appear crude and annoying. When ANTIC encounters the DLI instruction, it completes the last scan line for the mode it is drawing, then services the interrupt. This means in effect that the interrupt must be set during the mode line above the one you want the interrupt to effect.; $81 = frame counter
; $82 = random number seed
; $85 = attract mode XOR mask
; $86 = attract mode AND mask
; $87 = player 1 color
; $88 = player 2 color
; $89 = water color
; $8A = player 1 underwater color
; $8B = player 2 underwater color
; $8C = header color
; $8D = water color #2
; $8E = oxygen bar color
; $8F = sea bed color
; $90 = used up O2 bar color
; $91 = logo and diver color
; $92,$93 = score digit 1 temp
; $94,$95 = score digit 2 temp
; $96,$97 = score digit 3 temp
; $98,$99 = score digit 4 temp, player sub graphics pointer
; $9A,$9B = score digit 5 temp
; $9C,$9D = score digit 6 temp
; $9E-A1 = enemy positions
; $A2 = attract counter (inc on $81 rollover, cleared on movement)
; $A4-A7 = enemy repeat flags
; D2 = 1 left
; D1 = 1 middle
; D0 = 1 right
; $A8-AB = visible enemy repeat flags
; $AC-AF = shark/sub colors
; $B0-B3 = diver hurry-up flags
; $B4 = row index of enemy hit by missile ($FF = none)
; $B5 = row index of enemy hit by player ($FF = none)
; $B6 = row index of diver rescued by player ($FF = none)
; $B7 = current player (0/1)
; $B8 = score hi byte
; $B9 = score med byte
; $BA = score low byte
; $BB = lives left
; $BD = wave (0+)
; $BE = diver count (0-6)
; $BF = other player score hi byte
; $C0 = other player score med byte
; $C1 = other player score low byte
; $C6 = player horizontal position
; $C7-CA = diver/shot horizontal position
; $CE = shark/sub point value
; $D6 = player reflect bit (bit 3)
; $D9-DC = enemy flags
; D4 = 1 diver present
; D3 = 1 reflect horizontally
; D0-D2 shark/sub frame
; $DD = shark vertical offset (0-7)
; $E0 = player sub frame
; $E1 = player vertical location
; $E6 = O2 level (0-64)
; $E7 = player missile position
; $E8 = victory flags
; 0 normal
; 1 refilling (NOT when surfacing with less than 6 divers)
; 6 awarding points for remaining O2
; $E9 = death effect downcounter
; $EA = diver sound effect counter
; $F6 = enemy patrol boat position
; $F8 = player/enemy collision byte
SCREEN(SCREENI+$150)=0
SCREEN(SCREENI+$120)=0
SCREEN(SCREENI+$F0)=0
SCREEN(SCREENI+$C0)=0
SCREEN(SCREENI+$90)=0
SCREEN(SCREENI+$60)=0
SCREEN(SCREENI+$30)=0
SCREEN(SCREENI)=0
FOR CTMP1=0 TO $150 STEP $30 DO
SCREEN(SCREENI+CTMP1)=0
OD
; wizualne porównanie czasu pracy procedur
RSYNC(50)
[RASTERBARON]
SCREEN(SCREENI+$150)=0
SCREEN(SCREENI+$120)=0
SCREEN(SCREENI+$F0)=0
SCREEN(SCREENI+$C0)=0
SCREEN(SCREENI+$90)=0
SCREEN(SCREENI+$60)=0
SCREEN(SCREENI+$30)=0
SCREEN(SCREENI)=0
[RASTERBAROFF]
RSYNC(60)
[RASTERBARON]
CTMP1=SCREENI DO
SCREEN(CTMP1)=0
CTMP1==+$30
UNTIL CTMP1=SCREENI+$150
OD
[RASTERBAROFF]
RSYNC(70)
[RASTERBARON]
FOR CTMP1=0 TO $150 STEP $30 DO
SCREEN(SCREENI+CTMP1)=0
OD
[RASTERBAROFF]
SCREEN(SCREENI+$150)=0
SCREEN(SCREENI+$120)=0
SCREEN(SCREENI+$F0)=0
SCREEN(SCREENI+$C0)=0
SCREEN(SCREENI+$90)=0
SCREEN(SCREENI+$60)=0
SCREEN(SCREENI+$30)=0
SCREEN(SCREENI)=0
112E: 18 CLC
112F: A5 5E LDA $5E ;OLDADR
1131: 69 50 ADC #$50
1133: 85 AE STA $AE ;LELNUM+1
1135: A5 5F LDA $5F ;OLDADR+1
1137: 69 01 ADC #$01
1139: 85 AF STA $AF ;STENUM
113B: 18 CLC
113C: AD 0C 0E LDA $0E0C
113F: 65 AE ADC $AE ;LELNUM+1
1141: 85 AC STA $AC ;EXSVPR
1143: AD 0D 0E LDA $0E0D
1146: 65 AF ADC $AF ;STENUM
1148: 85 AD STA $AD ;LELNUM
114A: A9 00 LDA #$00
114C: A0 00 LDY #$00
114E: 91 AC STA ($AC),Y ;EXSVPR
1150: 18 CLC
1151: A5 5E LDA $5E ;OLDADR
1153: 69 20 ADC #$20
1155: 85 AE STA $AE ;LELNUM+1
1157: A5 5F LDA $5F ;OLDADR+1
1159: 69 01 ADC #$01
115B: 85 AF STA $AF ;STENUM
115D: 18 CLC
115E: AD 0C 0E LDA $0E0C
1161: 65 AE ADC $AE ;LELNUM+1
1163: 85 AC STA $AC ;EXSVPR
1165: AD 0D 0E LDA $0E0D
1168: 65 AF ADC $AF ;STENUM
116A: 85 AD STA $AD ;LELNUM
116C: A9 00 LDA #$00
116E: 91 AC STA ($AC),Y ;EXSVPR
1170: 18 CLC
1171: A5 5E LDA $5E ;OLDADR
1173: 69 F0 ADC #$F0
1175: 85 AE STA $AE ;LELNUM+1
1177: A5 5F LDA $5F ;OLDADR+1
1179: 69 00 ADC #$00
117B: 85 AF STA $AF ;STENUM
117D: 18 CLC
117E: AD 0C 0E LDA $0E0C
1181: 65 AE ADC $AE ;LELNUM+1
1183: 85 AC STA $AC ;EXSVPR
1185: AD 0D 0E LDA $0E0D
1188: 65 AF ADC $AF ;STENUM
118A: 85 AD STA $AD ;LELNUM
118C: A9 00 LDA #$00
118E: 91 AC STA ($AC),Y ;EXSVPR
1190: 18 CLC
1191: A5 5E LDA $5E ;OLDADR
1193: 69 C0 ADC #$C0
1195: 85 AE STA $AE ;LELNUM+1
1197: A5 5F LDA $5F ;OLDADR+1
1199: 69 00 ADC #$00
119B: 85 AF STA $AF ;STENUM
119D: 18 CLC
119E: AD 0C 0E LDA $0E0C
11A1: 65 AE ADC $AE ;LELNUM+1
11A3: 85 AC STA $AC ;EXSVPR
11A5: AD 0D 0E LDA $0E0D
11A8: 65 AF ADC $AF ;STENUM
11AA: 85 AD STA $AD ;LELNUM
11AC: A9 00 LDA #$00
11AE: 91 AC STA ($AC),Y ;EXSVPR
11B0: 18 CLC
11B1: A5 5E LDA $5E ;OLDADR
11B3: 69 90 ADC #$90
11B5: 85 AE STA $AE ;LELNUM+1
11B7: A5 5F LDA $5F ;OLDADR+1
11B9: 69 00 ADC #$00
11BB: 85 AF STA $AF ;STENUM
11BD: 18 CLC
11BE: AD 0C 0E LDA $0E0C
11C1: 65 AE ADC $AE ;LELNUM+1
11C3: 85 AC STA $AC ;EXSVPR
11C5: AD 0D 0E LDA $0E0D
11C8: 65 AF ADC $AF ;STENUM
11CA: 85 AD STA $AD ;LELNUM
11CC: A9 00 LDA #$00
11CE: 91 AC STA ($AC),Y ;EXSVPR
11D0: 18 CLC
11D1: A5 5E LDA $5E ;OLDADR
11D3: 69 60 ADC #$60
11D5: 85 AE STA $AE ;LELNUM+1
11D7: A5 5F LDA $5F ;OLDADR+1
11D9: 69 00 ADC #$00
11DB: 85 AF STA $AF ;STENUM
11DD: 18 CLC
11DE: AD 0C 0E LDA $0E0C
11E1: 65 AE ADC $AE ;LELNUM+1
11E3: 85 AC STA $AC ;EXSVPR
11E5: AD 0D 0E LDA $0E0D
11E8: 65 AF ADC $AF ;STENUM
11EA: 85 AD STA $AD ;LELNUM
11EC: A9 00 LDA #$00
11EE: 91 AC STA ($AC),Y ;EXSVPR
11F0: 18 CLC
11F1: A5 5E LDA $5E ;OLDADR
11F3: 69 30 ADC #$30
11F5: 85 AE STA $AE ;LELNUM+1
11F7: A5 5F LDA $5F ;OLDADR+1
11F9: 69 00 ADC #$00
11FB: 85 AF STA $AF ;STENUM
11FD: 18 CLC
11FE: AD 0C 0E LDA $0E0C
1201: 65 AE ADC $AE ;LELNUM+1
1203: 85 AC STA $AC ;EXSVPR
1205: AD 0D 0E LDA $0E0D
1208: 65 AF ADC $AF ;STENUM
120A: 85 AD STA $AD ;LELNUM
120C: A9 00 LDA #$00
120E: 91 AC STA ($AC),Y ;EXSVPR
1210: 18 CLC
1211: AD 0C 0E LDA $0E0C
1214: 65 5E ADC $5E ;OLDADR
1216: 85 AE STA $AE ;LELNUM+1
1218: AD 0D 0E LDA $0E0D
121B: 65 5F ADC $5F ;OLDADR+1
121D: 85 AF STA $AF ;STENUM
121F: A9 00 LDA #$00
1221: 91 AE STA ($AE),Y ;LELNUM+1
FOR CTMP1=0 TO $150 STEP $30 DO
SCREEN(SCREENI+CTMP1)=0
OD
1126: A0 00 LDY #$00
1128: 84 62 STY $62 ;PALNTS
112A: 84 61 STY $61 ;FKDEF+1
112C: A9 50 LDA #$50
112E: C5 61 CMP $61 ;FKDEF+1
1130: A9 01 LDA #$01
1132: E5 62 SBC $62 ;PALNTS
1134: B0 03 BCS $1139
1136: 4C 6B 11 JMP $116B
1139: 18 CLC
113A: A5 5E LDA $5E ;OLDADR
113C: 65 61 ADC $61 ;FKDEF+1
113E: 85 AE STA $AE ;LELNUM+1
1140: A5 5F LDA $5F ;OLDADR+1
1142: 65 62 ADC $62 ;PALNTS
1144: 85 AF STA $AF ;STENUM
1146: 18 CLC
1147: AD 0C 0E LDA $0E0C
114A: 65 AE ADC $AE ;LELNUM+1
114C: 85 AC STA $AC ;EXSVPR
114E: AD 0D 0E LDA $0E0D
1151: 65 AF ADC $AF ;STENUM
1153: 85 AD STA $AD ;LELNUM
1155: A9 00 LDA #$00
1157: A0 00 LDY #$00
1159: 91 AC STA ($AC),Y ;EXSVPR
115B: 18 CLC
115C: A5 61 LDA $61 ;FKDEF+1
115E: 69 30 ADC #$30
1160: 85 61 STA $61 ;FKDEF+1
1162: A5 62 LDA $62 ;PALNTS
1164: 69 00 ADC #$00
1166: 85 62 STA $62 ;PALNTS
1168: 4C 2C 11 JMP $112C
CTMP2=STARTSCREEN+SCREENI
FOR BTMP1=0 TO 7 DO
[$A9$0$A0$00$91$CC]
CTMP2==+$30
OD
112E: 18 CLC
112F: A9 00 LDA #$00
1131: 65 5E ADC $5E ;OLDADR
1133: 85 CC STA $CC
1135: A9 80 LDA #$80
1137: 65 5F ADC $5F ;OLDADR+1
1139: 85 CD STA $CD
113B: A0 00 LDY #$00
113D: 84 CA STY $CA ;LOADFLG
113F: A9 07 LDA #$07
1141: C5 CA CMP $CA ;LOADFLG
1143: B0 03 BCS $1148
1145: 4C 60 11 JMP $1160
1148: A9 00 LDA #$00
114A: A0 00 LDY #$00
114C: 91 CC STA ($CC),Y
114E: 18 CLC
114F: A5 CC LDA $CC
1151: 69 30 ADC #$30
1153: 85 CC STA $CC
1155: A5 CD LDA $CD
1157: 69 00 ADC #$00
1159: 85 CD STA $CD
115B: E6 CA INC $CA ;LOADFLG
115D: 4C 3F 11 JMP $113F
1160: 00 BRK
CTMP2=STARTSCREEN+SCREENI
[
$A2$07$A9$00$A8$91$CC$18
$A5$CC$69$30$85$CC$A5$CD$69$00
$85$CD$CA$10$EB
]
; CTMP2=STARTSCREEN+SCREENI
1126: 18 CLC
1127: A9 00 LDA #$00
1129: 65 5E ADC $5E
112B: 85 CC STA $CC
112D: A9 80 LDA #$80
112F: 65 5F ADC $5F
1131: 85 CD STA $CD
; moj kod w ASM
1133: A2 07 LDX #$07
1135: A9 00 LDA #$00
1137: A8 TAY
1138: 91 CC STA ($CC),Y
113A: 18 CLC
113B: A5 CC LDA $CC
113D: 69 30 ADC #$30
113F: 85 CC STA $CC
1141: A5 CD LDA $CD
1143: 69 00 ADC #$00
1145: 85 CD STA $CD
1147: CA DEX
1148: 10 EB BPL $1135
1133: A2 07 LDX #$07
1135: A9 00 LDA #$00
1137: A8 TAY
1138: 91 CC STA ($CC),Y
113A: 18 CLC
113B: A5 CC LDA $CC
113D: 69 30 ADC #$30
113F: 85 CC STA $CC
1141: 90 02 BCC $1145
1143: E6 CD INC $CD
1145: CA DEX
1146: 10 ED BPL $1135
LDX #$07
LDY #$00
tu
TYA
STA ($CC),Y
CLC
LDA $CC
ADC #$30
STA $CC
BCC tam
INC $CD
tam
DEX
BPL tu
Mq:
Mad Pascal umie wtedy dobrze to zrobić, czy Action potrafi? Tego nie wiem. Ale zapewne spece od Action wiedzą jak taki kod pisać, tylko że tu wracamy do punktu wyjścia, że tego assemblera nie da się uniknąć.; old code
DEFINE
DRAWROW="MATRIX(SCREENI+ROWOFFSET(ROW))",
DRAWNEXTROW="MATRIX(SCREENI+ROWOFFSET(NEXTROW))"
IF ROW=6 THEN
IF TILE=3 THEN
DRAWROW=GLADE RET
ELSE
NEXTROW=5
DRAWROW=RSLOPE
DRAWNEXTROW=RFILL
RET
FI
FI
; new code
IF ROW=6 THEN
IF TILE=3 THEN
POKE(SCREENI,GLADE) RET
ELSE
ROW=5
POKE(SCREENI,RSLOPE)
SCREENI==+$30
POKE(SCREENI,RFILL)
RET
FI
FI
./65xedebugger SCRAMBLE.XEX
ANTIC.nmien = NMIEN_DLI | NMIEN_VBI;
BYTE ARRAY
SHIPSBODYTABLE=[1 1 3 3 5],
SHIPSHEADTABLE=[2 4 4 6 6]
PROC DRAWROCKET=*()
SHIPTYPE=RANDOM & 15
IF SHIPTYPE>4 THEN RET FI
POKE(SCREENI-$30,SHIPSBODYTABLE(SHIPTYPE))
POKE(SCREENI-$60,SHIPSHEADTABLE(SHIPTYPE))
RET
; old
PROC DRAWCANNON=*()
POKE(SCREENI-$32,27)
POKE(SCREENI-$62,0)
POKE(SCREENI-$31,28)
POKE(SCREENI-$61,0)
POKE(SCREENI-$30,29)
POKE(SCREENI-$60,30)
RET
; new
POKEC(SCREENI-$32,$1C1B)
POKEC(SCREENI-$62,0)
POKE(SCREENI-$30,29)
POKE(SCREENI-$60,30)
RET
CARD
SCREENI=$5E, ; REUSED OLDADR
CTMP1=$CA
;----------------------------------------------------------
; DRAW TERRAIN CHAR
;----------------------------------------------------------
PROC TPoke=*(BYTE v)
[$A0$00$91$5E$60]
; 0E6D: A0 00 LDY #$00
; 0E6F: 91 5E STA ($5E),Y ;OLDADR
; 0E71: 60 RTS
;----------------------------------------------------------
; DRAW BUILDINGS CHAR
;----------------------------------------------------------
PROC BPoke=*(BYTE v)
[$A0$00$91$CA$60]
; 0E72: A0 00 LDY #$00
; 0E74: 91 CA STA ($CA),Y ;LOADFLG
; 0E76: 60 RTS
;----------------------------------------------------------
; DRAW BUILDINGS TWO CHARS
;----------------------------------------------------------
PROC BPokeC=*(CARD v)
[$A0$00$91$CA$C8$8A$91$CA$60]
; 0E77: A0 00 LDY #$00
; 0E79: 91 CA STA ($CA),Y ;LOADFLG
; 0E7B: C8 INY
; 0E7C: 8A TXA
; 0E7D: 91 CA STA ($CA),Y ;LOADFLG
; 0E7F: 60 RTS
;----------------------------------------------------------
; PROCEDURE DRAWS ION CANNON STRUCTURE
;----------------------------------------------------------
PROC DRAWCANNON=*()
CTMP1=SCREENI-$32 BPOKEC($1C1B)
CTMP1=SCREENI-$62 BPOKEC(0)
CTMP1=SCREENI-$30 BPOKE(29)
CTMP1=SCREENI-$60 BPOKE(30)
RET
POKE(SCREENI-$30,29)
SHIPTYPE=RANDOM & 15
IF SHIPTYPE>4 THEN RET FI
POKEADDR=SCREENI-$30 ELMPOKE(SHIPSBODY(SHIPTYPE))
0F11: AD 0A D2 LDA $D20A ;RANDOM
0F14: 29 0F AND #$0F
0F16: 85 60 STA $60 ;FKDEF
0F18: A9 04 LDA #$04
0F1A: C5 60 CMP $60 ;FKDEF
0F1C: 90 03 BCC $0F21
0F1E: 4C 22 0F JMP $0F22
0F21: 60 RTS
0F22: 38 SEC
0F23: A5 5E LDA $5E ;OLDADR
0F25: E9 30 SBC #$30
0F27: 85 CA STA $CA ;LOADFLG
0F29: A5 5F LDA $5F ;OLDADR+1
0F2B: E9 00 SBC #$00
0F2D: 85 CB STA $CB
0F2F: 18 CLC
0F30: AD 4F 0E LDA $0E4F
0F33: 65 60 ADC $60 ;FKDEF
0F35: 85 AE STA $AE ;LELNUM+1
0F37: AD 50 0E LDA $0E50
0F3A: 69 00 ADC #$00
0F3C: 85 AF STA $AF ;STENUM
0F3E: A0 00 LDY #$00
0F40: B1 AE LDA ($AE),Y ;LELNUM+1
0F42: 85 A0 STA $A0 ;TSLNUM
0F44: A5 A0 LDA $A0 ;TSLNUM
0F46: 20 DB 0E JSR $0EDB
BTMP2==+1
IF (BTMP2&1)=0 THEN
BTMP1==+1
IF (BTMP1&3)=0 THEN MOVEBLOCK(CHARSET+96,CHARSET+104,8) FI
IF (BTMP1&3)=1 THEN MOVEBLOCK(CHARSET+96,CHARSET+112,8) FI
IF (BTMP1&3)=2 THEN MOVEBLOCK(CHARSET+96,CHARSET+104,8) FI
IF (BTMP1&3)=3 THEN MOVEBLOCK(CHARSET+96,CHARSET+120,8) FI
FI
BTMP1==+1
IF BTMP1=1 THEN CHBAS=$60 FI
IF BTMP1=2 THEN CHBAS=$64 FI
IF BTMP1=3 THEN CHBAS=$68 FI
IF BTMP1=4 THEN CHBAS=$6B FI
IF BTMP1=5 THEN CHBAS=$68 FI
IF BTMP1=6 THEN CHBAS=$64 FI
IF BTMP1=7 THEN CHBAS=$60 BTMP1=0 FI
zbyti:
O ile za pierwszym razem CHBAS mogę ustawić na dowolnie wybranej stronie pamięci (...)