Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
ygopro-core
Commits
63d9a249
Commit
63d9a249
authored
Jun 15, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Fluorohydride/ygopro-core into develop
parents
76b4b3ad
1aed2254
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
23 deletions
+16
-23
README.md
README.md
+2
-0
buffer.h
buffer.h
+4
-2
card.cpp
card.cpp
+3
-3
card_data.h
card_data.h
+7
-18
No files found.
README.md
View file @
63d9a249
...
@@ -62,6 +62,8 @@ Get all cards in some location.
...
@@ -62,6 +62,8 @@ Get all cards in some location.
-
`int32_t preload_script(intptr_t pduel, const char* script_name);`
-
`int32_t preload_script(intptr_t pduel, const char* script_name);`
-
`byte* default_script_reader(const char* script_name, int* len);`
The default script reader using
`fread`
.
# Lua functions
# Lua functions
-
`libcard.cpp`
-
`libcard.cpp`
...
...
buffer.h
View file @
63d9a249
...
@@ -12,7 +12,8 @@ inline void buffer_read_block(unsigned char*& p, void* dest, size_t size) {
...
@@ -12,7 +12,8 @@ inline void buffer_read_block(unsigned char*& p, void* dest, size_t size) {
template
<
typename
T
>
template
<
typename
T
>
inline
T
buffer_read
(
unsigned
char
*&
p
)
{
inline
T
buffer_read
(
unsigned
char
*&
p
)
{
T
ret
{};
T
ret
{};
buffer_read_block
(
p
,
&
ret
,
sizeof
(
T
));
std
::
memcpy
(
&
ret
,
p
,
sizeof
(
T
));
p
+=
sizeof
(
T
);
return
ret
;
return
ret
;
}
}
...
@@ -22,7 +23,8 @@ inline void buffer_write_block(unsigned char*& p, const void* src, size_t size)
...
@@ -22,7 +23,8 @@ inline void buffer_write_block(unsigned char*& p, const void* src, size_t size)
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
void
buffer_write
(
unsigned
char
*&
p
,
T
value
)
{
inline
void
buffer_write
(
unsigned
char
*&
p
,
T
value
)
{
buffer_write_block
(
p
,
&
value
,
sizeof
(
T
));
std
::
memcpy
(
p
,
&
value
,
sizeof
(
T
));
p
+=
sizeof
(
T
);
}
}
inline
void
vector_write_block
(
std
::
vector
<
unsigned
char
>&
buffer
,
const
void
*
src
,
size_t
size
)
{
inline
void
vector_write_block
(
std
::
vector
<
unsigned
char
>&
buffer
,
const
void
*
src
,
size_t
size
)
{
...
...
card.cpp
View file @
63d9a249
...
@@ -505,9 +505,9 @@ uint32_t card::get_another_code() {
...
@@ -505,9 +505,9 @@ uint32_t card::get_another_code() {
return
0
;
return
0
;
}
}
inline
bool
check_setcode
(
uint16_t
setcode
,
uint32_t
value
)
{
inline
bool
check_setcode
(
uint16_t
setcode
,
uint32_t
value
)
{
uint32_t
settype
=
value
&
0x0fffU
;
const
uint32_t
settype
=
value
&
0x0fffU
;
uint32_t
setsubtype
=
value
&
0xf000U
;
const
uint32_t
setsubtype
=
value
&
0xf000U
;
return
(
setcode
&
0x0fffU
)
==
settype
&&
(
setcode
&
0xf000U
&
setsubtype
)
==
setsubtype
;
return
(
setcode
&
0x0fffU
)
==
settype
&&
(
setcode
&
setsubtype
)
==
setsubtype
;
}
}
int32_t
card
::
is_set_card
(
uint32_t
set_code
)
{
int32_t
card
::
is_set_card
(
uint32_t
set_code
)
{
uint32_t
code1
=
get_code
();
uint32_t
code1
=
get_code
();
...
...
card_data.h
View file @
63d9a249
#ifndef CARD_DATA_H_
#ifndef CARD_DATA_H_
#define CARD_DATA_H_
#define CARD_DATA_H_
#include <cstring>
#include <unordered_map>
#include <unordered_map>
#include "common.h"
#include "common.h"
...
@@ -38,26 +39,14 @@ struct card_data {
...
@@ -38,26 +39,14 @@ struct card_data {
uint32_t
link_marker
{};
uint32_t
link_marker
{};
void
clear
()
{
void
clear
()
{
code
=
0
;
std
::
memset
(
this
,
0
,
sizeof
(
card_data
));
alias
=
0
;
for
(
auto
&
x
:
setcode
)
x
=
0
;
type
=
0
;
level
=
0
;
attribute
=
0
;
race
=
0
;
attack
=
0
;
defense
=
0
;
lscale
=
0
;
rscale
=
0
;
link_marker
=
0
;
}
}
bool
is_setcode
(
uint32_t
value
)
const
{
bool
is_setcode
(
uint32_t
value
)
const
{
uint16_t
settype
=
value
&
0x0fff
;
const
uint16_t
settype
=
value
&
0x0fff
;
uint16_t
setsubtype
=
value
&
0xf000
;
const
uint16_t
setsubtype
=
value
&
0xf000
;
for
(
auto
&
x
:
setcode
)
{
for
(
auto
&
x
:
setcode
)
{
if
((
x
&
0x0fff
)
==
settype
&&
(
x
&
0xf000
&
setsubtype
)
==
setsubtype
)
if
((
x
&
0x0fff
)
==
settype
&&
(
x
&
setsubtype
)
==
setsubtype
)
return
true
;
return
true
;
if
(
!
x
)
if
(
!
x
)
return
false
;
return
false
;
...
@@ -80,8 +69,8 @@ struct card_data {
...
@@ -80,8 +69,8 @@ struct card_data {
}
}
value
>>=
16
;
value
>>=
16
;
}
}
for
(
int
i
=
ctr
;
i
<
SIZE_SETCODE
;
++
i
)
if
(
ctr
<
SIZE_SETCODE
)
s
etcode
[
i
]
=
0
;
s
td
::
memset
(
setcode
+
ctr
,
0
,
(
SIZE_SETCODE
-
ctr
)
*
sizeof
(
uint16_t
))
;
}
}
uint32_t
get_original_code
()
const
{
uint32_t
get_original_code
()
const
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment