This website works better with JavaScript.
Home
Explore
Help
Sign In
forestbelton
/
island-story
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
0
Wiki
Activity
Browse Source
Wait for vblank with HALT
master
Forest Belton
3 years ago
parent
333e6413a3
commit
833b910df7
2 changed files
with
15 additions
and
6 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+10
-1
src/main.s
+5
-5
src/player.s
+ 10
- 1
src/main.s
View File
@ -14,6 +14,11 @@ SECTION "Frame", WRAM0
frame:
:
db
frame:
:
db
SECTION
"
VBlank
"
,
ROM0
[
$40
]
handle_vblank:
reti
SECTION
"
Code
"
,
ROM0
SECTION
"
Code
"
,
ROM0
start:
start:
@ -21,6 +26,9 @@ start:
res
7
,
[
hl
]
res
7
,
[
hl
]
res
2
,
[
hl
]
res
2
,
[
hl
]
ld
hl
,
rIE
ld
[
hl
],
IEF_VBLANK
call
BG_Init
call
BG_Init
call
OAM_Init
call
OAM_Init
call
Keys_Init
call
Keys_Init
@ -46,7 +54,8 @@ start:
call
Keys_Update
call
Keys_Update
call
Player_Update
call
Player_Update
call
wait_for_vblank
;
wait
for
vblank
halt
ld
a
,
HIGH
(
_OAM
)
ld
a
,
HIGH
(
_OAM
)
call
DMA_Start
call
DMA_Start
+ 5
- 5
src/player.s
View File
@ -54,11 +54,11 @@ Player_Init::
Player_Update:
:
Player_Update:
:
;
Only
update
every
2
frames
;
Only
update
every
2
frames
ld
hl
,
frame
ld
a
,
[
hl
]
and
%
1
cp
%
1
ret
nz
;
ld
hl
,
frame
;
ld
a
,
[
hl
]
;
and
%
1
;
cp
%
1
;
ret
nz
ld
hl
,
keys
ld
hl
,
keys
ld
b
,
[
hl
]
ld
b
,
[
hl
]
Write
Preview
Loading…
Cancel
Save