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.
;
; Example of using the vertical blank
; deferred interrupt from Action
;
BYTE RTCLOCK = 20,
CH = $2FC,
COLOR2 = $2C6
CARD VVBLKD = $224,
SDLST = $230,
OLDVEC
DEFINE JMPI = "$6C"
;
; Within a VBI you can't call any
; subroutines, nor can you multiply
; or divide. . . .
PROC VBLANKD()
COLOR2 = RTCLOCK
[JMPI OLDVEC]
;Simulate the OS call SETVBV
PROC SETVBV(BYTE WHICH CARD ADDR)
CARD POINTER TEMP
BYTE V
TEMP = $216 + (WHICH LSH 1)
V = RTCLOCK+ 1
WHILE V <> RTCLOCK DO OD
TEMP^ = ADDR
RETURN
PROC MAIN()
BYTE OLDC2
OLDC2 = COLOR2
PRINTE("Setting up Vblank")
OLDVEC = VVBLKD
SETVBV(7, VBLANKD)
WHILE CH = $FF DO
PRINTE("Press any key to quit")
OD
CH = $FF ;Swallow key press
PrintE("Restoring Vblank")
Setvbv(7, OLDVEC)
COLOR2 = OLDC2
PRINTE("Returning")
RETURN
Reserved keywords
AND Fl OR UNTIL = (
ARRAY FOR POINTER WHILE <> )
BYTE FUNC PROC XOR # .
CARD IF RETURN = > [
CHAR INCLUDE RSH - >= ]
DEFINE INT SET * < "
DO LSH STEP / <= '
ELSE MOD THEN & $ ;
ELSEIF MODULE TO % <
EXIT OD TYPE ! @
----------------------------------------------------
Library procedures.
Print PrintE PrintD PrintDE PrintB PrintBE
PrintBD PrintBDE PrintC PrintCE PrintCD PrintCDE
PrintI PrintIE PrintID PrintIDE Put PutE
PutD PutDE InputS InputSD InputMD Open
Close XIO Note Point Graphics SetColor
Plot DrawTo Fill Position Sound SndRst
SCopy SCopyS SAssign StrB StrC StrI
Break Error Zero SetBlock MoveBlock
----------------------------------------------------
Library functions.
InputB InputC InputI InputBD InpuCD InputID
GetD Locate Paddle PTrig Stick STrig
SCompare ValB ValC ValI Rand Peek
PeekC Poke PokeC
PROC MAIN()
CARD SAVMSC=$58
BYTE ARRAY SCREEN
SCREEN=SAVMSC
SCREEN(0)=32
RETURN
;------------------------------------------
* = 1000
1000 A5 59 LDA $59
1002 8D A8 0E STA $0EA8
1005 A5 58 LDA $58
1007 8D A7 0E STA $0EA7
100A AD A7 0E LDA $0EA7
100D 85 AE STA $AE
100F AD A8 0E LDA $0EA8
1012 85 AF STA $AF
1014 A9 20 LDA #$20
1016 A0 00 LDY #$00
1018 91 AE STA ($AE),Y
101A 60 RTS
101B 60 RTS
101C .END
PROC MAIN()
CARD SAVMSC=$58
BYTE POINTER SCREEN
SCREEN=SAVMSC
SCREEN^=32
RETURN
;------------------------------------------
* = 1000
1000 A5 59 LDA $59
1002 8D 93 0E STA $0E93
1005 A5 58 LDA $58
1007 8D 92 0E STA $0E92
100A AD 92 0E LDA $0E92
100D 85 AE STA $AE
100F AD 93 0E LDA $0E93
1012 85 AF STA $AF
1014 A9 20 LDA #$20
1016 A0 00 LDY #$00
1018 91 AE STA ($AE),Y
101A 60 RTS
101B 60 RTS
101C .END
The Action! Toolkit Section 3:
You will recall from Section 1 we mentioned that, by default, Action! supports only up to 255 Global symbols (as well as up to 255 Local symbols). The limit on the length of any given symbol (name) is greater than the limit on the length of a line, so virtually any name is valid. However, the total space occupied by names and Action!'s associated type bytes, values, etc., cannot exceed the space reserved via STSP ($495).;PROC Poke(CARD address, BYTE value)
; store byte or char value at address
; (single byte store)
poke sta arg0
stx arg1
tya
ldy #0
sta (arg0),y
rts
;
;PROC PokeC(CARD address, value)
; store cardinal or integer value at
; address (2 byte store)
pokec jsr poke
iny
lda arg3
sta (arg0),y
rts
;
CARD SDLSTL=$230
BYTE POINTER SCREEN
BYTE RTCLOCK=$14
BYTE ARRAY
KING=[0
0 0 0 0 0 0 0 $18 0 0 $18 0 0 $7E 0 7 $7E $E0
$F $99 $F0 $1F $DB $F8 $1F $FF $F8 $1F $FF $F8
$1F $E7 $F8 $1F $DB $F8 $F $BD $F0 7 $BD $E0 7
$DB $E0 2 $66 $40 3 $FF $C0 1 0 $80 1 $FF $80
],
QUEEN=[0
0 0 0 0 0 0 0 0 0 $11 $18 $88 $1B $BD $D8 $1B
$BD $D8 $1B $BD $D8 $1F $FF $F8 $1F $FF $F8 $1F
$FF $F8 $1F $FF $F8 $F $FF $F0 $F $FF $F0 $C 0
$30 7 $FF $E0 6 0 $60 $3 $FF $C0 3 0 $C0 1 $FF $80
],
DL=[$70 $70 $4F $00 $40
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
$41 0 0
]
;------------------------------------
PROC WAIT(BYTE FRAMES)
FRAMES==+RTCLOCK
WHILE FRAMES<>RTCLOCK DO OD
RETURN
;------------------------------------
PROC DRAW_PIECE(BYTE ARRAY PIECE, BYTE POS)
BYTE I1,I2,INV
SCREEN==+POS
FOR I2=0 TO 3
DO
IF (I2 & 1) THEN INV=$FF ELSE INV=0 FI
FOR I1=1 TO 57
DO
SCREEN^=INV ! PIECE(I1)
SCREEN==+1
IF (I1 MOD 3)=0 THEN SCREEN==+37 FI
OD
OD
RETURN
;------------------------------------
PROC MAIN()
CARD
SCREEN1=$4000,
SCREEN2=$5000
BYTE I
PRINTE("PLEASE WAIT...")
FOR I=0 TO 36 STEP 3
DO
SCREEN=@SCREEN1
DRAW_PIECE(QUEEN,I)
OD
FOR I=0 TO 36 STEP 3
DO
SCREEN=@SCREEN2
DRAW_PIECE(KING,I)
OD
SDLSTL=DL
DO
WAIT(10)
DL(4)=$50
WAIT(10)
DL(4)=$40
OD
RETURN
ANTIC OS
$02 $00
$03 -
$04 $0C
$05 $0D
$06 $01
$07 $02
$08 $03
$09 $04
$0A $05
$0B $06
$0C $0E
$0D $07
$0E $0F
$0F $08
Decimal Hex mode lines line line
15 $F 8 1 320 40 graphics mode 8
65 $41 -- -- -- -- jump & wait VBLANK
112 $70 -- 8 -- -- 8 blank lines
Basic Mode Number : 8
Antic Number : 15
Type : graphics
LMS Byte : $4F
Mode Lines : 192
Scan Lines per Mode Line : 1
Bytes per Mode Line : 40
LMS
Rozkazem ładowania wskaźnika pamięci ekranu (LMS - Load Memory Scan) może być każdy z rozkazów tworzenia linii trybu. Uzyskuje się to przez ustawienie bitu 6 kodu rozkazu oraz podanie adresu danych obrazu w dwóch następnych bajtach.
DL=[$70 $70 $4F $00 $40
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
$41 0 0
]
BYTE ARRAY P=0; POKE(710,10) P(710)=10
,DIS=[112
66 $50 $9B
2 2 4 4 4 4 4 4 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
$40 2
65 0 0
]
;
.local dl8
.byte $70,$70 ;2x8 empty scanlines
.byte $4f,a(schess1)
:94 .byte $0f
.byte $4f,a(schess2)
:92 .byte $0f
.byte $41,a(dl8) ;Wait VBL, jump DL
.endl
.local dl0
.byte $70,$70,$70 ;3x8 empty scanlines
.byte $42,a(stext)
:23 .byte $02
.byte $41,a(dl0) ;Wait VBL, jump DL
.endl
;
dlist_ptr==+22
dlist_ptr^=save_dlist_ptr-((save_dlist_ptr RSH 8) LSH 8)
dlist_ptr==+1
dlist_ptr^=save_dlist_ptr RSH 8 ;divide by 256!
dma=0 ; turn off the antic chip
dlist_vector=save_dlist_ptr; install the dlist vector
savmsc=old_savmsc; reset the screen starting address
dma=34 ; turn on the antic chip
mkolodziejski:
@tdc - jeszcze raz wielkie dzięki za te warsztaty - inspirują!