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.
org $2000
lda #<loop
sta $e0
lda #>loop
sta $e1
loop inx
stx $d01a
jmp ($e0) ;dereferences to loop
- rozszerzona składnia makro rozkazu MWA o możliwość użycia adresowania pośredniego strony zerowej postindeksowanego Y, np.:
mwa ($80),y $a000,x
mwa $bc40,y ($f0),y
mwa ($80),y ($82),y
schess1 = $3000
schess2 = $4000
stext = $5000
RTCLOCK = $14
org $2000
mwa #dl8 $230 ;Set Display List pointer
mva #0 RTCLOCK
lda #<schess1
sta $e0
lda #>schess1
STA $e1
lda #$ff
ldx #0
ldy #0
loop sta ($e0),y
iny
bne loop
inx
inc $e1
cpx #$1f
bne loop
mva RTCLOCK stext
mva #$ff $2fc
anykey cmp $2fc
beq anykey
mwa #dl2 $230 ;Set Display List pointer
jmp * ;End
.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 dl2
.byte $70,$70 ;2x8 empty scanlines
.byte $42,a(stext)
.byte $02
.byte $41,a(dl2) ;Wait VBL, jump DL
.endl
Listing 5.
10 REM * SCREEN-FILL BENCHMARK
11 GRAPHICS 24
12 POKE 19,0:POKE 20,0
13 SCREEN=PEEK(88)+256*PEEK(89)
14 FOR I=0 TO 31
15 FOR J=0 TO 239
16 POKE SCREEN+J,255
17 NEXT J
18 SCREEN=SCREEN+240
19 NEXT I
20 TIME=PEEK(20)+256*PEEK(19)
21 GRAPHICS 0
22 PRINT TIME;" JIFFIES"
Listing 7.
BYTE RTCLOCK=20, ; addr of sys timer
SAVMSCL=88, ; lsb of screen addr
SAVMSCH=89, ; msb
I,J,TIME ; declare variables
CARD SCREEN
PROC BENCH()
GRAPHICS(24)
RTCLOCK=0
SCREEN=SAVMSCL+256*SAVMSCH
FOR I=0 TO 31
DO
FOR J=0 TO 239
DO
POKE(SCREEN+J,255)
OD
SCREEN==+240
OD
TIME=RTCLOCK
GRAPHICS(0)
PRINTF("%E %U JIFFIES",TIME)
RETURN
ldx $00
ldx #$1f
ldy #0
loop sta ($e0),y
iny
bne loop
inc $e1
dex
bpl loop
loop sta schess1,y
iny
bne loop
inc loop+2
- [common]
--- main.c
--- main.h
--- level.c
--- level.h
--- system.h
--- input.h
--- gfx.h
--- sfx.h
- [platforms]
--- [atari]
------ system.c
------ input.c
------ gfx.c
------ sfx.c
--- [allegro]
------ system.c
------ input.c
------ gfx.c
------ sfx.c
// include common headers
#include "level.h"
// include headers of platform dependent functions
#include "system.h"
#include "input.h"
#include "gfx.h"
#include "sfx.h"
int main(void)
{
byte action;
init_system(); // tu inicjalizacja konkretnej platformy np. stworzenie okna Allegro lub ekranu DLI na Atari.
for(;;)
{
load_level(); // common function to load level
play_music(MUSIC_TRACK_1); // call function in sfx.c
while(!level_complete)
{
draw_screen(); // call function in input.c (or even .ASM)
action = get_player_action(); // call function in input.c
if (action == ACTION_MOVE)
{
perform_move(); // common game logic
play_sound(SFX_MOVE); // call function in sfx.c
}
}
}
}
Od 1 do 47 z 47