Skip to content

Commit

Permalink
Merge pull request #64 from jbrandwood/master
Browse files Browse the repository at this point in the history
Add cd_fastvram() function to the HuCC library to fix HuC's slow CD loading to VRAM.
  • Loading branch information
jbrandwood authored Dec 21, 2024
2 parents fbfc888 + 0434756 commit 1b4b7fb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions include/hucc/hucc-systemcard.asm
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,34 @@ _cd_playmsf.7 .proc



; ***************************************************************************
; ***************************************************************************
;
; unsigned char __fastcall cd_loadvram( unsigned char ovl_index<_cl>, unsigned int sect_offset<_si>, unsigned int vramaddr<_bx>, unsigned int sectors<_al> );

_cd_fastvram.4 .proc

ldx <_cl ; Get file address and length.
jsr get_file_lba

lda.l <_si ; Add the sector offset.
ldy.h <_si
jsr _add_sectors

lda #$FF ; Signal a VRAM load.
sta <_dh

system cd_read
tax ; Put return code in X.

cly ; Return code in Y:X, X -> A.

leave ; Return and copy X -> A.

.endp



; ***************************************************************************
; ***************************************************************************
;
Expand Down
1 change: 1 addition & 0 deletions include/hucc/hucc-systemcard.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ extern unsigned char __fastcall cd_unpause( void );
extern void __fastcall __macro cd_fade( unsigned char type<acc> );
extern unsigned char __fastcall cd_playtrk( unsigned char start_track<_bx>, unsigned char end_track<_cx>, unsigned char mode<_dh> );
extern unsigned char __fastcall cd_playmsf( unsigned char start_minute<_al>, unsigned char start_second<_ah>, unsigned char start_frame<_bl>, unsigned char end_minute<_cl>, unsigned char end_second<_ch>, unsigned char end_frame<_dl>, unsigned char mode<_dh> );
extern unsigned char __fastcall cd_fastvram( unsigned char ovl_index<_cl>, unsigned int sect_offset<_si>, unsigned int vramaddr<_bx>, unsigned int sectors<_al> );
extern unsigned char __fastcall cd_loadvram( unsigned char ovl_index<_cl>, unsigned int sect_offset<_si>, unsigned int vramaddr<_bx>, unsigned int bytes<_ax> );
extern unsigned char __fastcall cd_loaddata( unsigned char ovl_index<_cl>, unsigned int sect_offset<_si>, unsigned char __far *buffer<_bp_bank:_bp>, unsigned int bytes<__ptr> );
extern unsigned char __fastcall cd_loadbank( unsigned char ovl_index<_cl>, unsigned int sect_offset<_si>, unsigned char bank<_bl>, unsigned int sectors<_al> );
Expand Down

0 comments on commit 1b4b7fb

Please sign in to comment.