Skip to content

Commit

Permalink
v2.18.3.7258
Browse files Browse the repository at this point in the history
commit 29d29a6
refs #24
* #24 Control に 0x80 フラグが入っている状態の SPC をロードした場合、IPL がロードされない
  • Loading branch information
dgrfactory committed Mar 14, 2021
1 parent a5c0ef8 commit ce1c297
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions snesapu.dll/APU.asm
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ SECTION .data ALIGN=256
SECTION .data ALIGN=32
%endif

; ----- degrade-factory code [2020/12/28] -----
; ----- degrade-factory code [2021/02/18] -----
apuOpt DD (CPU_CYC << 24) | (DEBUG << 16) | (DSPINTEG << 17) | (VMETERM << 8) | (VMETERV << 9) | (1 << 10) | (STEREO << 11) \
| (HALFC << 1) | (CNTBK << 2) | (SPEED << 3) | (IPLW << 4) | (DSPBK << 5) | (INTBK << 6)
apuDllVer DD 21863h ;SNESAPU.DLL Current Version
apuCmpVer DD 11000h ;SNESAPU.DLL Backwards Compatible Version
apuVerStr DD "2.18.3 (build 7249)" ;SNESAPU.DLL Current Version (32byte String)
apuVerStr DD "2.18.3 (build 7258)" ;SNESAPU.DLL Current Version (32byte String)
DD 8
; ----- degrade-factory code [END] -----

Expand Down
30 changes: 22 additions & 8 deletions snesapu.dll/SPC700.asm
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ USES ECX,EDX,EBX,ESI,EDI
Mov DL,[inPSW]
Mov EBX,PSW
Mov AH,8

.Flag:
Mov dword [EBX],0
ShR DL,1
Expand Down Expand Up @@ -490,13 +491,21 @@ USES ECX,EDX,EBX,ESI,EDI
Mov [RAM+control],AL

;Copy the correct extra RAM --------------
Test byte [RAM+control],80h
RetNZ

LEA ESI,[RAM+ipl]
Mov EDI,extraRAM
; ----- degrade-factory code [2021/02/18] -----
LEA ESI,[RAM+ipl] ;Setup registers to move data from Extra RAM to
Mov EDI,extraRAM ; IPL region
Mov ECX,10h

%if IPLW
Test AL,AL
JNS short .NoRA
Mov EDI,ESI ;Setup registers to move ROM program into IPL region
Mov ESI,iplROM
.NoRA:
%endif

Rep MovSD
; ----- degrade-factory code [END] #24 -----

ENDP

Expand All @@ -509,6 +518,7 @@ USES EBX

Mov EBX,PSW+1
Mov AL,80h

.Flag:
Mov AH,[EBX]
Add EBX,4
Expand Down Expand Up @@ -4995,25 +5005,28 @@ ALIGN 16
XOr AL,BL ;Did ROM access change?
JNS short %%NoRA ; No
Push ECX,ESI,EDI

Mov ESI,extraRAM ;Setup registers to move data from Extra RAM to
Mov DI,ipl ; IPL region

Mov ECX,10h

Test BL,BL ;Is ROM readable?
JNS short %%NoRR ; No, Perform move as intended
XChg ESI,EDI ;Reverse original operation, move IPL to Extra RAM
Rep MovSD

Mov CL,10h ;Setup registers to move ROM program into IPL region
LEA EDI,[ESI-40h]
Mov ESI,iplROM

%%NoRR:
Rep MovSD ;Move iplROM or extraRAM to IPL ROM region
Pop EDI,ESI,ECX

%%NoRA:
; ----- degrade-factory code [END] -----

;Clear ports -----------------------------
; ----- degrade-factory code [2015/02/28] -----
Test BL,30h ;Was a clear ports command written?
JZ short %%NoCP ; No
Mov EAX,EBX
Expand All @@ -5023,9 +5036,10 @@ ALIGN 16
SAR AX,15
And dword [RAM+port0],EAX ;Reset in-ports
And dword [inPortCp],EAX
; ----- degrade-factory code [2015/02/28] -----
And dword [flushPort],EAX
%%NoCP:
; ----- degrade-factory code [END] -----
%%NoCP:

;Timer control ---------------------------
Mov AL,[tControl] ;AL = Timers currently enabled
Expand Down
4 changes: 2 additions & 2 deletions snesapu.dll/version.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1 VERSIONINFO
FILEVERSION 2,18,3,7249
FILEVERSION 2,18,3,7258
PRODUCTVERSION 2,18,3,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x8L
Expand All @@ -12,7 +12,7 @@ BEGIN
BLOCK "041103A4"
BEGIN
VALUE "FileDescription", "SNES SPC700 Emulator\0"
VALUE "FileVersion", "2.18.3 (build 7249)\0"
VALUE "FileVersion", "2.18.3 (build 7258)\0"
VALUE "LegalCopyright", "Copyright (C) 1999-2008 Alpha-II Productions; (C) 2003-2021 degrade-factory.\0"
VALUE "LegalTrademarks", "SNES is a registered trademark of Nintendo.\0"
VALUE "ProductName", "SNESAPU\0"
Expand Down
2 changes: 1 addition & 1 deletion spcplay.exe/spcplay.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -2327,7 +2327,7 @@ const
DEFAULT_TITLE: string = 'SNES SPC700 Player';
SPCPLAY_TITLE = '[ SNES SPC700 Player ]' + CRLF + ' SPCPLAY.EXE v';
SNESAPU_TITLE = '[ SNES SPC700 Emulator ]' + CRLF + ' SNESAPU.DLL v';
SPCPLAY_VERSION = '2.18.3 (build 7249)';
SPCPLAY_VERSION = '2.18.3 (build 7258)';
SNESAPU_VERSION = $21863;
APPLINK_VERSION = $02170500;

Expand Down
4 changes: 2 additions & 2 deletions spcplay.exe/spcplay.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MAINICON ICON DISCARDABLE "spcplay.ico"
MAINBMP BITMAP DISCARDABLE "spcplay.bmp"

1 VERSIONINFO
FILEVERSION 2,18,3,7249
FILEVERSION 2,18,3,7258
PRODUCTVERSION 2,18,3,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x8L
Expand All @@ -15,7 +15,7 @@ BEGIN
BLOCK "041103A4"
BEGIN
VALUE "FileDescription", "SNES SPC700 Player\0"
VALUE "FileVersion", "2.18.3 (build 7249)\0"
VALUE "FileVersion", "2.18.3 (build 7258)\0"
VALUE "LegalCopyright", "Copyright (C) 2003-2021 degrade-factory.\0"
VALUE "LegalTrademarks", "SNES is a registered trademark of Nintendo.\0"
VALUE "ProductName", "SPCPLAY\0"
Expand Down

0 comments on commit ce1c297

Please sign in to comment.