- Move TIM ISR emulation to dedicated function .tim_emulation and dedicated file timer_isr.s
- Make TIM ISR emulation save entirety of ALL_REGTEMPS_BEGIN to ALL_REGTEMPS_END
- Improve emulation to allow average TIM rate to be faster compared to vblank rate
- Add support for consistent average TIM rate on PAL, for a less system-dependent timer
- Add support for different base dividers defined by GB-like TAC_REG variable
- Add defines values for "vblank parity mode" to global.s and nes.h
- Update crt0 init code to set TMA_REG to vblank parity mode correctly for PAL/Dendy
- Update documentation, describing the improved GB TIM emulation and vblank parity mode
- Update cross-platform IRQ example to better showcase the emulation
- Move code for deferred isr buffer building to separate function .deferred_isr_run in file deferred_isr.s
- Introduce function .deferred_isr_reset to write shadow regs as first (VBL) buffer entry
- Add new subroutine .deferred_isr_reset_and_init that runs .deferred_isr_reset and .deferred_isr_run twice
- Drain buffer when DISPLAY_OFF is called, by making sure a single NMI execution happens before screen is turned off in vblank
- Change DISPLAY_OFF to write only DISPLAY_OFF flag and PPUMASK, but leave shadow_PPU_MASK unchanged
- Call .deferred_isr_reset_and_init in DISPLAY_ON when display changes from off to on
- Make DISPLAY_ON run run VBL / LCD handlers to reinitialize buffers when display switches from off to on
- Change early-out in NMI handler to rely on DISPLAY_OFF flag instead of shadow_PPUMASK
- Remove mentioned of manual-draining caveat in docs, as it no longer applies
- Add minor size/speed optimization of frame counter increment in NMI, to prevent branch penalties / incorrect system detection
* NES: Make sure TIM ISR handlers are thread-safe
- Backup and restore REGTEMP area when calling TIM ISR in vblank
- Update irq example to use #pragma nooverlay for tim handler
- Add warning and explanation about having to use #pragma for TIM handlers in NES section of docs
- Add @anchor to docs, and a code example for #pragma nooverlay
- Update irq.c with `#pragma nooverlay` only being applied if NINTENDO_NES is defined
- Add more detailed comment of `#pragma nooverlay` in irq.c
- Add reference to docs in gb.h
- Add similar reference to nes.h
NES: Align coordinates and scanline counting in LCD ISR implementation with GB, add SCX / SCY / LYC defines
- Change definition of _lcd_scanline to be -1 less than current, aligning with GB LYC register
- Change definition of _bkg_scroll_y to match GB's SCY, being relative to current scanline
- Refactor do_hblank_writes, delay_fractional and delay_to_scanline subroutines in crt0
- Add "#define LYC_REG" and "#define LY_REG" as aliases of _lcd_scanline
- Add #defines for SCX and SCY to alias _bkg_scroll_x / _bkg_scroll_y shadow variables
- Change text scroller example to use LYC_REG / SCX / SCY instead of _lcd_scanline / move_bkg, remove redundant #ifdefs
- Add subtle shake in y direction to text scroller example, to check that GB / NES coordinates match
- Update "From Game Boy to NES" section's descriptions of LCD handlers
- Update "Migrating to new GBDK versions" with a short description of bkg_scroll_y changing from absolute to relative Y coordinates for 4.4.0
NES: Move .nes header functionality out of makebin
- Move all .nes header related functionality into a new utility gbdk-support/makenes
- Update LCC to use makenes for .postproc member of build process, with mapper30 header parameters hard-coded for now
- Update makefiles to build makenes
- Add Makefile commands to generate output for the toolchain settings doc page
- Add documentation section for makenes in 06_toolchain.md
- Add add_TIM / remove_TIM functions to nes.h
- Refactor implementation in lcd.s to support add_TIM / remove_TIM
- Add TMA_REG / TIMA_REG / TAC_REG vars to emulate GB hardware timer register
- Add call to TIM function at end of NMI handler in crt0.s, and make it use TMA_REG / TIMA_REG vars
- Add implementation for set_interrupts in lcd.s, replacing JMP instruction with RTS when disabled
- Enable NES target in examples/cross-platform/irq and replace delay(1000) call with 60 vsyncs
- Update examples/cross-platform/scroller and examples/cross-platform/irq to use set_interrupts
- Update documentation to describe use-cases and limitations of TIM handler
* Refactor .delay_to_lcd_scanline to not use Y register. Remove outdated comments.
* Move .jmp_to_LCD_isr call to vsync routine, and have it copy shadow PPU register values to a buffer
* Add MAX_LCD_ISR_CALLS define to limit the deferred PPU register write buffer size
* Add .do_lcd_ppu_reg_writes for writing buffer aligned to hblank, and calls to .delay_to_lcd_scanline
* Make .do_lcd_ppu_reg_write restore Y-scroll for start-of-frame after every update, to mitigate glitches in lag frames
* Have LCD at scanline#0 be treated as a special-case, where VBL shadow values are replaced without adding to the buffer
* Re-introduce variable to skip NMI as __crt0_disableNMI, and set it in vsync during buffer building
Update text_scroller example:
* Fix NES-version of code to do multiple splits like the other platforms do
* Fill nametable with '*' to make splits more visible
* TODO: Find out why fill_bkg_rect isn't working on GB
- VScode c config for better GBDK var detection
- Recommend CURRENT_BANK over _current_bank
- FAQ entry about HIDE_LEFT_COLUMN
- More info about using the add_JOY() interrupt and improve docs for some linked constants
- Improve docs for reset()
- Improve docs for hblank_copy()
- Improve docs for base_prop metasprite parameter
- Improve docs for initrand() a bit