add support for older powerhsell

This commit is contained in:
Michael Miceli 2023-04-28 17:57:43 -04:00
parent c9d6049914
commit eb94c2a0cd
2 changed files with 14 additions and 3 deletions

View File

@ -146,7 +146,9 @@ In the video starting at 35m 19s, there was a section where a speedrunner named
`dk28` died in the middle of level 1, and was advanced to level 2 for their next
life. The video explains that there still isn't a known explanation as to why
this happened. This got me interested in the assembly and thus this project
began and has since changed in scope as my interest have changed.
began. Spoilers, I have not found the cause of the level skip bug. It is still
unknown whether the bug is from some bug in the code, or whether it was a
hardware glitch.
The _Contra_ (US) NES ROM was disassembled using a NES disassembly tool. This
provided a starting point for code investigation. The disassembler incorrectly

View File

@ -21,11 +21,20 @@ function Set-Bytes {
# only read baserom.nes once for speed improvements
IF ($global:SOURCE_CONTRA -eq $null) {
Write-Output " Reading input file baserom.nes."
$global:SOURCE_CONTRA = Get-Content .\baserom.nes -AsByteStream
IF ($PSVersionTable.PSVersion.Major -ge 6) {
$global:SOURCE_CONTRA = Get-Content .\baserom.nes -AsByteStream
} ELSE {
$global:SOURCE_CONTRA = Get-Content .\baserom.nes -Raw -Encoding Byte
}
}
Write-Output " Writing file $Output."
$global:SOURCE_CONTRA | Select-Object -Skip $Skip -First $Take | Set-Content $Output -AsByteStream
IF ($PSVersionTable.PSVersion.Major -ge 6) {
$global:SOURCE_CONTRA | Select-Object -Skip $Skip -First $Take | Set-Content $Output -AsByteStream
} ELSE {
$global:SOURCE_CONTRA | Select-Object -Skip $Skip -First $Take | Set-Content $Output -Encoding Byte
}
}
IF (Test-Path -Path "contra.nes") {