Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osu-fpga
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fang Lu
osu-fpga
Commits
0d009b07
Commit
0d009b07
authored
7 years ago
by
Fang Lu
Browse files
Options
Downloads
Patches
Plain Diff
interprocess - init
Not tested at all
parent
4c4244a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
software/interprocess/interprocess.h
+135
-0
135 additions, 0 deletions
software/interprocess/interprocess.h
software/osu_main/src/interprocess.h
+0
-5
0 additions, 5 deletions
software/osu_main/src/interprocess.h
with
135 additions
and
5 deletions
software/interprocess/interprocess.h
0 → 100644
+
135
−
0
View file @
0d009b07
#ifndef INTERPROCESS_H_
#define INTERPROCESS_H_
#include
<stdio.h>
#include
<inttypes.h>
#include
"system.h"
#include
"io.h"
#define ISD_BASE INTERPROC_SHARED_DATA_BASE
// Mouse: R
#define MOUSE_XY 0 // - 3
#define MOUSE_W 4 // - 5
#define MOUSE_BTN 6 //
// For main
#define mouse_xy IORD_32DIRECT(ISD_BASE, MOUSE_XY)
#define mouse_wheel IORD_16DIRECT(ISD_BASE, MOUSE_W)
#define mouse_btn IORD_8DIRECT(ISD_BASE, MOUSE_BTN)
// For usb
#define set_mouse_xy(val) IORD_32DIRECT(ISD_BASE, MOUSE_XY, val)
#define set_mouse_wheel(val) IORD_16DIRECT(ISD_BASE, MOUSE_W, val)
#define set_mouse_btn(val) IORD_8DIRECT(ISD_BASE, MOUSE_BTN, btn)
// Background: W
// Trig: ADDR
// Ready: ADDR
#define MPEG_BG_ADDR 12 // - 15
// For main
inline
void
mpeg_set_bg
(
uint32_t
addr
)
{
while
(
IORD_32DIRECT
(
ISD_BASE
,
MPEG_BG_ADDR
));
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_BG_ADDR
,
addr
);
}
// For mpeg
#define mpeg_bg IORD_32DIRECT(ISD_BASE, MPEG_BG_ADDR)
#define mpeg_bg_reset(val) IOWR_32DIRECT(ISD_BASE, MPEG_BG_ADDR, addr);
// Audio: W
// Trig: ADDR
// Ready: ADDR
#define MPEG_AUDIO_ADDR 16 // - 19
#define MPEG_AUDIO_LEN 20 // - 23
#define MPEG_AUDIO_START 24 // - 27
// For main
inline
void
mpeg_play_audio
(
uint32_t
addr
,
uint32_t
len
,
uint32_t
synctime
)
{
while
(
IORD_32DIRECT
(
ISD_BASE
,
MPEG_AUDIO_ADDR
));
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_AUDIO_LEN
,
len
);
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_AUDIO_START
,
synctime
);
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_AUDIO_ADDR
,
addr
);
}
inline
void
mpeg_cancel_audio
()
{
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_AUDIO_LEN
,
0
);
}
// For mpeg
#define mpeg_audio_addr IORD_32DIRECT(ISD_BASE, MPEG_AUDIO_ADDR)
#define mpeg_audio_len IORD_32DIRECT(ISD_BASE, MPEG_AUDIO_LEN)
#define mpeg_audio_start IORD_32DIRECT(ISD_BASE, MPEG_AUDIO_START)
#define mpeg_audio_reset(val) IOWR_32DIRECT(ISD_BASE, MPEG_AUDIO_ADDR, val)
// Audio Mixdown: W
// Trig: ADDR
// Ready: ADDR
#define MPEG_MIX_ADDR 28 // - 31
#define MPEG_MIX_LEN 32 // - 35
// For main
inline
void
mpeg_play_fx
(
uint32_t
addr
,
uint32_t
len
)
{
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_MIX_LEN
,
len
);
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_MIX_ADDR
,
addr
);
}
// For mpeg
#define mpeg_fx_addr IORD_32DIRECT(ISD_BASE, MPEG_MIX_ADDR)
#define mpeg_fx_len IORD_32DIRECT(ISD_BASE, MPEG_MIX_LEN)
#define mpeg_fx_reset(val) IOWR_32DIRECT(ISD_BASE, MPEG_MIX_ADDR, val)
// Generic Read: RW
// Trig: ADDR
// Ready: ADDR
#define MPEG_READ_ADDR 36 // - 39
#define MPEG_READ_LEN 40 // - 43
#define MPEG_READ_PTR1 44 // - 47
#define MPEG_READ_PTR2 48 // - 51
// For main
inline
void
mpeg_read
(
uint32_t
addr
,
uint32_t
len
,
void
*
buf
)
{
uint64_t
ptr
=
(
uint64_t
)
buf
;
while
(
IORD_32DIRECT
(
ISD_BASE
,
MPEG_READ_ADDR
));
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_READ_LEN
,
len
);
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_READ_PTR1
,
ptr
&
0xffff
);
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_READ_PTR2
,
(
ptr
&
0xffff0000
)
>>
32
);
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_READ_ADDR
,
addr
);
}
// For mpeg
#define mpeg_read_addr IORD_32DIRECT(ISD_BASE, MPEG_READ_ADDR)
#define mpeg_read_len IORD_32DIRECT(ISD_BASE, MPEG_READ_LEN)
#define mpeg_read_ptr (void *)((IORD_32DIRECT(ISD_BASE, MPEG_READ_PTR2)<<32)|IORD_32DIRECT(ISD_BASE, MPEG_READ_PTR1))
#define mpeg_read_reset(val) IOWR_32DIRECT(ISD_BASE, MPEG_READ_ADDR, val)
// Sprite: W
// Trig: ADDR
// Ready: DEST
#define MPEG_IMG_ADDR 52 // - 55
#define MPEG_IMG_WIDTH 56 // - 57
#define MPEG_IMG_HEIGHT 58 // - 59
#define MPEG_IMG_DEST1 60 // - 63
#define MPEG_IMG_DEST2 64 // - 67
// For main
inline
void
mpeg_read
(
uint32_t
addr
,
uint16_t
w
,
uint16_t
h
,
uint64_t
dest
)
{
while
(
IORD_32DIRECT
(
ISD_BASE
,
MPEG_IMG_ADDR
));
IOWR_16DIRECT
(
ISD_BASE
,
MPEG_IMG_WIDTH
,
w
);
IOWR_16DIRECT
(
ISD_BASE
,
MPEG_IMG_HEIGHT
,
h
);
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_IMG_DEST1
,
dest
&
0xffff
);
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_IMG_DEST2
,
(
dest
&
0xffff0000
)
>>
32
);
IOWR_32DIRECT
(
ISD_BASE
,
MPEG_IMG_ADDR
,
addr
);
}
// For mpeg
#define mpeg_read_addr IORD_32DIRECT(ISD_BASE, MPEG_IMG_ADDR)
#define mpeg_read_width IORD_32DIRECT(ISD_BASE, MPEG_IMG_WIDTH)
#define mpeg_read_height IORD_32DIRECT(ISD_BASE, MPEG_IMG_HEIGHT)
#define mpeg_read_dest ((IORD_32DIRECT(ISD_BASE, MPEG_IMG_DEST2)<<32)|IORD_32DIRECT(ISD_BASE, MPEG_IMG_DEST1))
#define mpeg_read_reset(val) IOWR_32DIRECT(ISD_BASE, MPEG_IMG_ADDR, val)
#endif
This diff is collapsed.
Click to expand it.
software/osu_main/src/interprocess.h
deleted
100644 → 0
+
0
−
5
View file @
4c4244a0
#ifndef INTERPROCESS_H_
#define INTERPROCESS_H_
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment