Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimise in-game atad driver for size #1050

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
98582ed
Layout command tables in a more readable way.
Aug 7, 2023
6772978
Optimize struct ata_cmd_state_t layout:
Aug 7, 2023
09970c6
Improve readability of hddGameList.
Aug 7, 2023
9f94d0c
There is only ever one instance of struct ata_cmd_state_t.
Aug 7, 2023
a9a9fa4
Optimize busy wait code for smaller codegen:
Aug 7, 2023
b7db315
Drop redundant break:
Aug 7, 2023
d1f136f
Move gamestar support into a separate version of cdvdman, similar to …
Aug 7, 2023
ace96e0
Silence compiler warning.
Aug 7, 2023
cee3da4
Drop support for the in-game SMART-enable command:
Aug 7, 2023
486d08c
If the ATA_C_SMART command is not found in the table we can simplify …
Aug 7, 2023
6a9c44a
Use defined constant for encoding ata command double-write requirement.
Aug 7, 2023
7b1f423
Abstract masking operation.
Aug 7, 2023
ac3852e
Reduce variable scope.
Aug 7, 2023
69d1d4e
Extract function.
Aug 7, 2023
ec0d221
Encode time-out requirement in type.
Aug 7, 2023
e7cc018
Encode direction in type.
Aug 7, 2023
8dc1c01
Commands of type 6, 3, or 8 do not occur while in-game.
Aug 7, 2023
5b23c86
Remove dead code:
Aug 7, 2023
74eccb8
Inline function.
Aug 7, 2023
8555a5c
Simplify initialization logic a little bit.
Aug 7, 2023
699b2ed
These command types do not occur while in game.
Aug 7, 2023
707f54d
Remove duplicate table entry.
Aug 7, 2023
d8b7ada
Re-order table in (roughly) order of likelyhood.
Aug 7, 2023
c142cc8
Struct atad_devinfo is never initialised, so this condition is always…
Aug 7, 2023
aa80613
Inline function.
Aug 7, 2023
7f8ba1d
Roll-up unrolled loop.
Aug 7, 2023
fd37bfd
Inline lonesome if() statement:
Aug 8, 2023
2a12f0f
bugfix: ata non-commands that timed out did not properly clean up:
Aug 8, 2023
17d65de
The 'dir' state can be derived from the command when needed.
Aug 8, 2023
b746f49
Whitespace: apply clang-format, with minor manual adjustments.
Aug 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ IOP_OBJS = iomanx.o filexio.o ps2fs.o usbd.o bdmevent.o \
EECORE_OBJS = ee_core.o ioprp.o util.o \
udnl.o imgdrv.o eesync.o \
bdm_cdvdman.o IOPRP_img.o smb_cdvdman.o \
hdd_cdvdman.o hdd_hdpro_cdvdman.o cdvdfsv.o \
hdd_cdvdman.o hdd_gamestar_cdvdman.o hdd_hdpro_cdvdman.o cdvdfsv.o \
ingame_smstcpip.o smap_ingame.o smbman.o smbinit.o

PNG_ASSETS = load0 load1 load2 load3 load4 load5 load6 load7 usb usb_bd ilk_bd \
Expand Down Expand Up @@ -248,6 +248,7 @@ clean: download_lwNBD
$(MAKE) -C modules/iopcore/cdvdman USE_BDM=1 clean
$(MAKE) -C modules/iopcore/cdvdman USE_SMB=1 clean
$(MAKE) -C modules/iopcore/cdvdman USE_HDD=1 clean
$(MAKE) -C modules/iopcore/cdvdman USE_GAMESTAR=1 clean
$(MAKE) -C modules/iopcore/cdvdman USE_HDPRO=1 clean
echo " -cdvdfsv"
$(MAKE) -C modules/iopcore/cdvdfsv clean
Expand Down Expand Up @@ -391,6 +392,12 @@ modules/iopcore/cdvdman/hdd_cdvdman.irx: modules/iopcore/cdvdman
$(EE_ASM_DIR)hdd_cdvdman.s: modules/iopcore/cdvdman/hdd_cdvdman.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ hdd_cdvdman_irx

modules/iopcore/cdvdman/hdd_gamestar_cdvdman.irx: modules/iopcore/cdvdman
$(MAKE) $(CDVDMAN_PS2LOGO_FLAGS) $(CDVDMAN_DEBUG_FLAGS) USE_GAMESTAR=1 -C $< all

$(EE_ASM_DIR)hdd_gamestar_cdvdman.s: modules/iopcore/cdvdman/hdd_gamestar_cdvdman.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ hdd_gamestar_cdvdman_irx

modules/iopcore/cdvdman/hdd_hdpro_cdvdman.irx: modules/iopcore/cdvdman
$(MAKE) $(CDVDMAN_PS2LOGO_FLAGS) $(CDVDMAN_DEBUG_FLAGS) USE_HDPRO=1 -C $< all

Expand Down
2 changes: 2 additions & 0 deletions include/extern_irx.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ IMPORT_BIN2C(genvmc_irx);

IMPORT_BIN2C(hdd_cdvdman_irx);

IMPORT_BIN2C(hdd_gamestar_cdvdman_irx);

IMPORT_BIN2C(hdd_hdpro_cdvdman_irx);

IMPORT_BIN2C(lwnbdsvr_irx);
Expand Down
8 changes: 8 additions & 0 deletions modules/iopcore/cdvdman/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ IOP_CFLAGS += -DHDD_DRIVER
USE_DEV9 = 1
endif

ifeq ($(USE_GAMESTAR),1)
IOP_BIN = hdd_gamestar_cdvdman.irx
IOP_OBJS_DIR = obj.gamestar/
IOP_OBJS += device-hdd.o atad.o
IOP_CFLAGS += -DHDD_DRIVER -DATA_GAMESTAR_WORKAROUND
USE_DEV9 = 1
endif

ifeq ($(USE_HDPRO),1)
IOP_BIN = hdd_hdpro_cdvdman.irx
IOP_OBJS_DIR = obj.hdpro/
Expand Down
Loading