What's Changed
- HiROM | FastROM support by @DigiDwrf in #273
- Mouse support by @DigiDwrf in #274
- Super Scope support added, some other changes by @DigiDwrf in #276
- Super Scope Example update by @DigiDwrf in #277
- SMCONV fix by @DigiDwrf in #278
- Music inside HiROM mapped rom example and mouse support bug fixes by @DigiDwrf in #280
- Input fixes and VBlank ISR rewrite by @undisbeliever in #282
- Develop by @alekmaul in #283
- chore(*): fix wla version to 10.6 by @alekmaul in #284
- Develop by @alekmaul in #285
New Contributors
- @DigiDwrf made their first contribution in #273
- @undisbeliever made their first contribution in #282
Full Changelog: 4.2.0...4.3.0
Breaking Changes (tks undisbeliever for the log)
Interrupts:
- The VBlank ISR now detects lag frames.
- Code that uses
WaitForVBlank()
should be unaffected - Code that uses
wai
to pause execution will be treated as a lag-frame.
Seeinterrupt.h
documentation for more details. - CAUTION:
nmi_handler
is called on every VBlank interrupt (ie, no lag-frame detection).
- Code that uses
- The VBlank ISR will automatically transfer
oamMemory
to the PPU OAM on non lag-frames.nmi_handler
's that contain a DMA transfer to OAM should remove it.
nmiSet()
is now a function.nmiSet()
will disable IRQ interrupts, enable VBlank interrupts and enable Joypad Auto-Read.
tcc__registers_irq
has been renamed totcc__registers_nmi_isr
(it is not used by IRQ interrupts).
Inputs:
- The VBlank ISR will automatically read inputs on non-lag frames.
- Code that loops until a button is pressed must call
WaitForVBlank()
within the loop otherwise it will loop forever (See commit d450096). - The lag-frame detection will prevent the input variables from suddenly changing in the middle of the mainloop.
- The lag-frame detection will reduce dropped
keysUp()
andkeyDown()
events during lag-frames.
- Code that loops until a button is pressed must call
- Removed
scanPads()
,scanMPlay5()
,mouseRead()
,scanScope()
scanPads()
andscanMPlay5()
has been inlined into the VBlank ISR.mouseRead()
andscanScope()
is now private and automatically called by the VBlank ISR.
- Renamed
pad_keysrepeat
topad_keysdown
to better describe what it holds. padsDown()
,padsUp()
andpadsClear()
argument has changed to matchpadsCurrent()
.padsDown(0)
is unaffected.padsDown(1)
now returns the down keys of the 2nd controller.
padsDown()
is now a macro.
Changes
Interrupts:
- Rewrote the VBlank Interrupt Service Routine
- Please see the VBlank-ISR section of
interrupt.h
documentation for more details.
- Please see the VBlank-ISR section of
- Moved the VBlank ISR, VBlank variables and input reading code to a new
vblank.asm
file. - Added lag-frame detection to the VBlank ISR
WaitForVBlank()
is used to detect lag frames. A lag-frame is when a VBlank Interrupt occurs and the S-CPU is not inWaitForVBlank()
.nmi_handler
's can test for lag-frames using thevblank_flag
variable.
SeemyconsoleVblank()
in the Mode1ContinuosScroll example.
- Added a lag-frame counter:
lag_frame_counter
- Fixed a potential crash a VBlank Interrupt occurs in the middle of
nmiSet()
- Forced tcc imaginary registers to address 0
.RAMSECTION
s that would have movedtcc__registers
out of address 0 now cause a wla-dx linker error.
- VBlank ISR imaginary registers are now page-aligned to prevent a
D.l != 0
direct-page cycle penalty.
Inputs:
- Inputs are now read at the end of the VBlank ISR (to free VBlank time that can be used by the
nmi_handler
) - Fixed
scanPads()
andscanMPlay5()
erroneously readingREG_RDIO
. - Fixed high byte of
pad_keys
not cleared if input is not a standard controller. - Fixed
scanMPlay5()
not reading controllers 2 & 3 (3a3db70).- CAUTION: REG_WRIO ($4201) must not be written to while MultiPlayer5 is active.
- Multiplayer5 reading code clears
pad_keys
if the input is not a standard controller. - Fixed
padsClear()
not clearing the high-byte ofpad_keys*
variables. - Rewrote
padsClear()
andpadsUp()
- Fixed
pad_key*
array size ininput.h