gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit b0d77a5cd1d0a31ecc75c729da0f09d2530714e1 parent d78d7a22ba3e2e04cbfe6bc5c0fb208ffc976d54 Author: Toxa <untoxa@mail.ru> Date: Tue, 29 Nov 2022 21:43:36 +0300 vsync() alias for wait_vbl_done() Diffstat:
58 files changed, 99 insertions(+), 76 deletions(-)
diff --git a/gbdk-lib/examples/ap/galaxy/galaxy.c b/gbdk-lib/examples/ap/galaxy/galaxy.c @@ -583,7 +583,7 @@ void main() while(1) { /* Skip four VBLs (slow down animation) */ for(i = 0; i < 4; i++) - wait_vbl_done(); + vsync(); time++; fade(); door(); diff --git a/gbdk-lib/examples/ap/gb-dtmf/gb-dtmf.c b/gbdk-lib/examples/ap/gb-dtmf/gb-dtmf.c @@ -574,7 +574,7 @@ void main() ch_pos = 0; while(1) { - wait_vbl_done(); + vsync(); key1 = joypad(); if(key1 != key2){ diff --git a/gbdk-lib/examples/ap/gbdecompress/main.c b/gbdk-lib/examples/ap/gbdecompress/main.c @@ -32,7 +32,7 @@ void main(void) // Main loop processing goes here // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/ap/large_map/large_map.c b/gbdk-lib/examples/ap/large_map/large_map.c @@ -88,9 +88,9 @@ void main(){ } } if (redraw) { - wait_vbl_done(); + vsync(); set_camera(); redraw = FALSE; - } else wait_vbl_done(); + } else vsync(); } } diff --git a/gbdk-lib/examples/ap/lcd_isr_wobble/lcd_isr_wobble.c b/gbdk-lib/examples/ap/lcd_isr_wobble/lcd_isr_wobble.c @@ -22,7 +22,7 @@ void main() { set_interrupts(VBL_IFLAG | LCD_IFLAG); while (1) { - wait_vbl_done(); + vsync(); scanline_offsets = &scanline_offsets_tbl[(uint8_t)(sys_time >> 2) & 0x07u]; } } diff --git a/gbdk-lib/examples/ap/linkerfile/src/main.c b/gbdk-lib/examples/ap/linkerfile/src/main.c @@ -10,6 +10,6 @@ void main(void) // Game main loop processing goes here // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/ap/paint/paint.c b/gbdk-lib/examples/ap/paint/paint.c @@ -349,22 +349,22 @@ void splash() SHOW_SPRITES; for(; cursor_x < 120; cursor_x++) { - wait_vbl_done(); + vsync(); move_cursor(); plot(cursor_x, cursor_y, BLACK, SOLID); } for(; cursor_y < 94; cursor_y++) { - wait_vbl_done(); + vsync(); move_cursor(); plot(cursor_x, cursor_y, BLACK, SOLID); } for(; cursor_x > 40; cursor_x--) { - wait_vbl_done(); + vsync(); move_cursor(); plot(cursor_x, cursor_y, BLACK, SOLID); } for(; cursor_y > 50; cursor_y--) { - wait_vbl_done(); + vsync(); move_cursor(); plot(cursor_x, cursor_y, BLACK, SOLID); } @@ -402,7 +402,7 @@ void menu() SHOW_SPRITES; waitpadup(); do { - wait_vbl_done(); + vsync(); key = joypad(); if(key & (J_UP|J_DOWN|J_LEFT|J_RIGHT)) { if(key & J_UP) @@ -415,7 +415,7 @@ void menu() menu_cursor_pos = icons[menu_cursor_pos].right; move_menu_cursor(); while(slowdown && key == joypad()) { - wait_vbl_done(); + vsync(); slowdown--; } slowdown = 10; @@ -465,7 +465,7 @@ void run() SHOW_SPRITES; while(1) { - wait_vbl_done(); + vsync(); key = joypad(); if(key & (J_UP|J_DOWN|J_LEFT|J_RIGHT)) { if(key & J_UP && cursor_y > 0) @@ -478,7 +478,7 @@ void run() cursor_x++; move_cursor(); while(slowdown && key == joypad()) { - wait_vbl_done(); + vsync(); slowdown--; } slowdown = 1; diff --git a/gbdk-lib/examples/ap/scroller/text_scroller.c b/gbdk-lib/examples/ap/scroller/text_scroller.c @@ -67,6 +67,6 @@ void main() { // put next char set_vram_byte(scroller_vram_addr, *scroller_next_char - 0x20); } - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/ap/sgb_border/border.c b/gbdk-lib/examples/ap/sgb_border/border.c @@ -8,11 +8,11 @@ void main(void) { // Wait 4 frames // For SGB on PAL SNES this delay is required on startup, otherwise borders don't show up - for (uint8_t i = 4; i != 0; i--) wait_vbl_done(); + for (uint8_t i = 4; i != 0; i--) vsync(); DISPLAY_ON; set_sgb_border(border_chr, border_chr_size, border_map, border_map_size, border_pal, border_pal_size); while(1) { - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/ap/sgb_border/sgb_border.h b/gbdk-lib/examples/ap/sgb_border/sgb_border.h @@ -14,7 +14,7 @@ \code{.c} // Wait 4 frames // For PAL SNES this delay is required on startup - for (uint8_t i = 4; i != 0; i--) wait_vbl_done(); + for (uint8_t i = 4; i != 0; i--) vsync(); \endcode */ void set_sgb_border(unsigned char * tiledata, size_t tiledata_size, diff --git a/gbdk-lib/examples/ap/sgb_multiplayer/sgb_multiplayer.c b/gbdk-lib/examples/ap/sgb_multiplayer/sgb_multiplayer.c @@ -38,6 +38,6 @@ void main(void) { if (joypads.joy0 & J_START) { for (uint8_t i = 0; i < 4; i++) move_sprite(i, (i << 3) + 64, 64); } - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/ap/sound/sound.c b/gbdk-lib/examples/ap/sound/sound.c @@ -1019,7 +1019,7 @@ void wait_event(uint8_t mode) keys = 0; break; } - wait_vbl_done(); + vsync(); UPDATE_KEYS(); } } diff --git a/gbdk-lib/examples/ap/template_minimal/main.c b/gbdk-lib/examples/ap/template_minimal/main.c @@ -12,6 +12,6 @@ void main(void) // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/ap/template_subfolders/src/main.c b/gbdk-lib/examples/ap/template_subfolders/src/main.c @@ -26,6 +26,6 @@ void main(void) // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/cross-platform/banks_autobank/src/banks.c b/gbdk-lib/examples/cross-platform/banks_autobank/src/banks.c @@ -71,6 +71,6 @@ void main(void) while(1) { // Yield CPU till the end of each frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/src/main.c b/gbdk-lib/examples/cross-platform/gbdecompress/src/main.c @@ -34,7 +34,7 @@ void main(void) // Main loop processing goes here // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/cross-platform/incbin/src/main.c b/gbdk-lib/examples/cross-platform/incbin/src/main.c @@ -53,6 +53,6 @@ void main(void) // Game main loop processing goes here // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/cross-platform/large_map/src/large_map.c b/gbdk-lib/examples/cross-platform/large_map/src/large_map.c @@ -159,9 +159,9 @@ void main(){ } } if (redraw) { - wait_vbl_done(); + vsync(); set_camera(); redraw = FALSE; - } else wait_vbl_done(); + } else vsync(); } } diff --git a/gbdk-lib/examples/cross-platform/metasprites/src/metasprites.c b/gbdk-lib/examples/cross-platform/metasprites/src/metasprites.c @@ -158,7 +158,7 @@ void main(void) { } // wait for VBlank to slow down everything and reduce cpu use when idle - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/cross-platform/pong/src/pong.c b/gbdk-lib/examples/cross-platform/pong/src/pong.c @@ -138,6 +138,6 @@ void main(void) { move_sprite(3, ballX, ballY); // wait for VBlank to slow down everything - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/cross-platform/rle_map/src/main.c b/gbdk-lib/examples/cross-platform/rle_map/src/main.c @@ -52,10 +52,10 @@ void main() { scrollpos = 1; while(TRUE) { - wait_vbl_done(); + vsync(); // Scroll one pixel to the right - // (This should be done as close to wait_vbl_done and before + // (This should be done as close to vsync and before // the map drawing below to avoid tearing at the top of the screen) scrollpos++; move_bkg(scrollpos, 0); diff --git a/gbdk-lib/examples/cross-platform/scroller/src/text_scroller.c b/gbdk-lib/examples/cross-platform/scroller/src/text_scroller.c @@ -82,6 +82,6 @@ void main() { // put next char set_vram_byte(scroller_vram_addr, *scroller_next_char - 0x20); } - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/apa_image/src/main.c b/gbdk-lib/examples/gb/apa_image/src/main.c @@ -26,7 +26,7 @@ void main(void) SHOW_BKG; // Then load the palettes at the start of a new frame - wait_vbl_done(); + vsync(); if (_cpu == CGB_TYPE) { set_bkg_palette(BKGF_CGB_PAL0, CGB_ONE_PAL, scenery_palettes); } else { @@ -38,6 +38,6 @@ void main(void) while(1) { // Main processing goes here // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/galaxy/galaxy.c b/gbdk-lib/examples/gb/galaxy/galaxy.c @@ -583,7 +583,7 @@ void main() while(1) { /* Skip four VBLs (slow down animation) */ for(i = 0; i < 4; i++) - wait_vbl_done(); + vsync(); time++; fade(); door(); diff --git a/gbdk-lib/examples/gb/gb-dtmf/gb-dtmf.c b/gbdk-lib/examples/gb/gb-dtmf/gb-dtmf.c @@ -574,7 +574,7 @@ void main() ch_pos = 0; while(1) { - wait_vbl_done(); + vsync(); key1 = joypad(); if(key1 != key2){ diff --git a/gbdk-lib/examples/gb/gbdecompress/main.c b/gbdk-lib/examples/gb/gbdecompress/main.c @@ -32,7 +32,7 @@ void main(void) // Main loop processing goes here // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/incbin/src/main.c b/gbdk-lib/examples/gb/incbin/src/main.c @@ -53,6 +53,6 @@ void main(void) // Game main loop processing goes here // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/isr_vector/lcd_isr_wobble.c b/gbdk-lib/examples/gb/isr_vector/lcd_isr_wobble.c @@ -39,7 +39,7 @@ void main() { SHOW_BKG; while (TRUE) { - wait_vbl_done(); + vsync(); scanline_offsets = &scanline_offsets_tbl[(uint8_t)(sys_time >> 2) & 0x07u]; } } diff --git a/gbdk-lib/examples/gb/large_map/large_map.c b/gbdk-lib/examples/gb/large_map/large_map.c @@ -88,9 +88,9 @@ void main(){ } } if (redraw) { - wait_vbl_done(); + vsync(); set_camera(); redraw = FALSE; - } else wait_vbl_done(); + } else vsync(); } } diff --git a/gbdk-lib/examples/gb/lcd_isr_wobble/lcd_isr_wobble.c b/gbdk-lib/examples/gb/lcd_isr_wobble/lcd_isr_wobble.c @@ -22,7 +22,7 @@ void main() { set_interrupts(VBL_IFLAG | LCD_IFLAG); while (1) { - wait_vbl_done(); + vsync(); scanline_offsets = &scanline_offsets_tbl[(uint8_t)(sys_time >> 2) & 0x07u]; } } diff --git a/gbdk-lib/examples/gb/linkerfile/src/main.c b/gbdk-lib/examples/gb/linkerfile/src/main.c @@ -10,6 +10,6 @@ void main(void) // Game main loop processing goes here // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/paint/paint.c b/gbdk-lib/examples/gb/paint/paint.c @@ -349,22 +349,22 @@ void splash() SHOW_SPRITES; for(; cursor_x < 120; cursor_x++) { - wait_vbl_done(); + vsync(); move_cursor(); plot(cursor_x, cursor_y, BLACK, SOLID); } for(; cursor_y < 94; cursor_y++) { - wait_vbl_done(); + vsync(); move_cursor(); plot(cursor_x, cursor_y, BLACK, SOLID); } for(; cursor_x > 40; cursor_x--) { - wait_vbl_done(); + vsync(); move_cursor(); plot(cursor_x, cursor_y, BLACK, SOLID); } for(; cursor_y > 50; cursor_y--) { - wait_vbl_done(); + vsync(); move_cursor(); plot(cursor_x, cursor_y, BLACK, SOLID); } @@ -402,7 +402,7 @@ void menu() SHOW_SPRITES; waitpadup(); do { - wait_vbl_done(); + vsync(); key = joypad(); if(key & (J_UP|J_DOWN|J_LEFT|J_RIGHT)) { if(key & J_UP) @@ -415,7 +415,7 @@ void menu() menu_cursor_pos = icons[menu_cursor_pos].right; move_menu_cursor(); while(slowdown && key == joypad()) { - wait_vbl_done(); + vsync(); slowdown--; } slowdown = 10; @@ -465,7 +465,7 @@ void run() SHOW_SPRITES; while(1) { - wait_vbl_done(); + vsync(); key = joypad(); if(key & (J_UP|J_DOWN|J_LEFT|J_RIGHT)) { if(key & J_UP && cursor_y > 0) @@ -478,7 +478,7 @@ void run() cursor_x++; move_cursor(); while(slowdown && key == joypad()) { - wait_vbl_done(); + vsync(); slowdown--; } slowdown = 1; diff --git a/gbdk-lib/examples/gb/scroller/text_scroller.c b/gbdk-lib/examples/gb/scroller/text_scroller.c @@ -67,6 +67,6 @@ void main() { // put next char set_vram_byte(scroller_vram_addr, *scroller_next_char - 0x20); } - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/sgb_border/border.c b/gbdk-lib/examples/gb/sgb_border/border.c @@ -23,12 +23,12 @@ void main(void) { // Wait 4 frames // For SGB on PAL SNES this delay is required on startup, otherwise borders don't show up - for (uint8_t i = 4; i != 0; i--) wait_vbl_done(); + for (uint8_t i = 4; i != 0; i--) vsync(); // The display must be ON before calling set_sgb_border() DISPLAY_ON; set_sgb_border(border_data_tiles, sizeof(border_data_tiles), border_data_map, sizeof(border_data_map), border_data_palettes, sizeof(border_data_palettes)); while(1) { - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/sgb_border/sgb_border.h b/gbdk-lib/examples/gb/sgb_border/sgb_border.h @@ -17,7 +17,7 @@ \code{.c} // Wait 4 frames // For PAL SNES this delay is required on startup - for (uint8_t i = 4; i != 0; i--) wait_vbl_done(); + for (uint8_t i = 4; i != 0; i--) vsync(); \endcode */ void set_sgb_border(unsigned char * tiledata, size_t tiledata_size, diff --git a/gbdk-lib/examples/gb/sgb_multiplayer/sgb_multiplayer.c b/gbdk-lib/examples/gb/sgb_multiplayer/sgb_multiplayer.c @@ -22,7 +22,7 @@ void main(void) { // Wait 4 frames // For SGB on PAL SNES this delay is required on startup, otherwise borders don't show up - for (uint8_t i = 4; i != 0; i--) wait_vbl_done(); + for (uint8_t i = 4; i != 0; i--) vsync(); // init joypads joypad_init(4, &joypads); @@ -42,6 +42,6 @@ void main(void) { if (joypads.joy0 & J_START) { for (uint8_t i = 0; i < 4; i++) move_sprite(i, (i << 3) + 64, 64); } - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/sgb_pong/sgb_pong.c b/gbdk-lib/examples/gb/sgb_pong/sgb_pong.c @@ -139,6 +139,6 @@ void main(void) { move_sprite(3, ballX, ballY); // wait for VBlank to slow down everything - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/sgb_sfx/main.c b/gbdk-lib/examples/gb/sgb_sfx/main.c @@ -140,7 +140,7 @@ void main(void) { // Wait 4 frames // For SGB on PAL SNES this delay is required on startup, otherwise borders don't show up - for (uint8_t i = 4; i != 0; i--) wait_vbl_done(); + for (uint8_t i = 4; i != 0; i--) vsync(); DISPLAY_ON; @@ -150,7 +150,7 @@ void main(void) { update_display(); while(1) { - wait_vbl_done(); + vsync(); keys_last = keys; keys = joypad(); diff --git a/gbdk-lib/examples/gb/simple_physics/phys.c b/gbdk-lib/examples/gb/simple_physics/phys.c @@ -88,6 +88,6 @@ void main(void) { } else SpdX ++; // Done processing, yield CPU and wait for start of next frame (VBlank) - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/sound/sound.c b/gbdk-lib/examples/gb/sound/sound.c @@ -1056,7 +1056,7 @@ void wait_event(uint8_t mode) keys = 0; break; } - wait_vbl_done(); + vsync(); UPDATE_KEYS(); } } diff --git a/gbdk-lib/examples/gb/template_minimal/main.c b/gbdk-lib/examples/gb/template_minimal/main.c @@ -12,6 +12,6 @@ void main(void) // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/template_subfolders/src/main.c b/gbdk-lib/examples/gb/template_subfolders/src/main.c @@ -26,6 +26,6 @@ void main(void) // Done processing, yield CPU and wait for start of next frame - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gb/wav_sample/src/samptest.c b/gbdk-lib/examples/gb/wav_sample/src/samptest.c @@ -27,12 +27,12 @@ void main() UINT8 j = joypad(); if (j & J_A) { play_sample1(); - while (joypad() & J_A) wait_vbl_done(); + while (joypad() & J_A) vsync(); } else if (j & J_B) { play_sample2(); - while (joypad() & J_B) wait_vbl_done(); + while (joypad() & J_B) vsync(); } - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/gg/smoke/smoketest.c b/gbdk-lib/examples/gg/smoke/smoketest.c @@ -85,6 +85,6 @@ void main() { scroll_bkg(0, 1); } - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/msxdos/smoke/smoketest.c b/gbdk-lib/examples/msxdos/smoke/smoketest.c @@ -83,6 +83,6 @@ void main() { scroll_bkg(0, 1); } */ - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/nes/smoke/smoketest.c b/gbdk-lib/examples/nes/smoke/smoketest.c @@ -3,6 +3,6 @@ void main() { DISPLAY_ON; while(TRUE) { - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/examples/sms/smoke/smoketest.c b/gbdk-lib/examples/sms/smoke/smoketest.c @@ -85,6 +85,6 @@ void main() { scroll_bkg(0, 1); } - wait_vbl_done(); + vsync(); } } diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -764,7 +764,7 @@ void set_interrupts(uint8_t flags) OLDCALL PRESERVES_REGS(b, c, d, e); */ void reset(); -/** HALTs the CPU and waits for the vertical blank interrupt (VBL) to finish. +/** HALTs the CPU and waits for the vertical blank interrupt. This is often used in main loops to idle the CPU at low power until it's time to start the next frame. It's also useful for @@ -774,6 +774,10 @@ void reset(); never return. If the screen is off this function returns immediately. */ +void vsync() PRESERVES_REGS(b, c, d, e, h, l); + +/** Obsolete +*/ void wait_vbl_done() PRESERVES_REGS(b, c, d, e, h, l); /** Turns the display off. diff --git a/gbdk-lib/include/msx/msx.h b/gbdk-lib/include/msx/msx.h @@ -202,7 +202,7 @@ inline void scroll_bkg(int8_t x, int8_t y) { __WRITE_VDP_REG(VDP_RSCY, (tmp < 0) ? 224 + tmp : tmp % 224u); } -/** HALTs the CPU and waits for the vertical blank interrupt (VBL) to finish. +/** HALTs the CPU and waits for the vertical blank interrupt. This is often used in main loops to idle the CPU at low power until it's time to start the next frame. It's also useful for @@ -212,6 +212,10 @@ inline void scroll_bkg(int8_t x, int8_t y) { never return. If the screen is off this function returns immediately. */ +void vsync() PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); + +/** Obsolete +*/ void wait_vbl_done() PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); /** Turns the display off. diff --git a/gbdk-lib/include/nes/nes.h b/gbdk-lib/include/nes/nes.h @@ -326,7 +326,7 @@ inline void disable_interrupts() { __asm__("sei"); } -/** Waits for the vertical blank interrupt (VBL) to finish. +/** Waits for the vertical blank interrupt. This is often used in main loops to idle the CPU until it's time to start the next frame. It's also useful for @@ -335,6 +335,10 @@ inline void disable_interrupts() { Warning: If the VBL interrupt is disabled, this function will never return. */ +void vsync(); + +/** Obsolete +*/ void wait_vbl_done(); /** Turns the display off. diff --git a/gbdk-lib/include/sms/sms.h b/gbdk-lib/include/sms/sms.h @@ -206,7 +206,7 @@ inline void scroll_bkg(int8_t x, int8_t y) { __WRITE_VDP_REG(VDP_RSCY, (tmp < 0) ? 224 + tmp : tmp % 224u); } -/** HALTs the CPU and waits for the vertical blank interrupt (VBL) to finish. +/** HALTs the CPU and waits for the vertical blank interrupt. This is often used in main loops to idle the CPU at low power until it's time to start the next frame. It's also useful for @@ -216,6 +216,10 @@ inline void scroll_bkg(int8_t x, int8_t y) { never return. If the screen is off this function returns immediately. */ +void vsync() PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); + +/** Obsolete +*/ void wait_vbl_done() PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); /** Turns the display off. diff --git a/gbdk-lib/libc/targets/mos6502/nes/crt0.s b/gbdk-lib/libc/targets/mos6502/nes/crt0.s @@ -547,6 +547,7 @@ __crt0_clearVRAM_loop: .wait_vbl_done:: _wait_vbl_done:: +_vsync:: lda *_sys_time _wait_vbl_done_waitForNextFrame_loop: cmp *_sys_time diff --git a/gbdk-lib/libc/targets/sm83/ap/crt0.s b/gbdk-lib/libc/targets/sm83/ap/crt0.s @@ -472,6 +472,7 @@ gsinit:: ;; Wait for VBL interrupt to be finished .wait_vbl_done:: _wait_vbl_done:: +_vsync:: ;; Check if the screen is on LDH A,(.LCDC) AND #LCDCF_ON diff --git a/gbdk-lib/libc/targets/sm83/duck/crt0.s b/gbdk-lib/libc/targets/sm83/duck/crt0.s @@ -412,6 +412,7 @@ gsinit:: ;; Wait for VBL interrupt to be finished .wait_vbl_done:: _wait_vbl_done:: +_vsync:: ;; Check if the screen is on LDH A,(.LCDC) AND #LCDCF_ON diff --git a/gbdk-lib/libc/targets/sm83/gb/crt0.s b/gbdk-lib/libc/targets/sm83/gb/crt0.s @@ -482,6 +482,7 @@ gsinit:: ;; Wait for VBL interrupt to be finished .wait_vbl_done:: _wait_vbl_done:: +_vsync:: ;; Check if the screen is on LDH A,(.LCDC) AND #LCDCF_ON diff --git a/gbdk-lib/libc/targets/z80/gg/crt0.s b/gbdk-lib/libc/targets/z80/gg/crt0.s @@ -184,6 +184,7 @@ _WRITE_VDP_DATA:: ;; Wait for VBL interrupt to be finished .wait_vbl_done:: _wait_vbl_done:: +_vsync:: ld a, (_shadow_VDP_R1) and #.R1_DISP_ON ret z diff --git a/gbdk-lib/libc/targets/z80/msxdos/crt0.s b/gbdk-lib/libc/targets/z80/msxdos/crt0.s @@ -299,6 +299,7 @@ __mapper_bank_alloc:: ;; Wait for VBL interrupt to be finished .wait_vbl_done:: _wait_vbl_done:: +_vsync:: ld a, (_shadow_VDP_R1) and #.R1_DISP_ON ret z diff --git a/gbdk-lib/libc/targets/z80/sms/crt0.s b/gbdk-lib/libc/targets/z80/sms/crt0.s @@ -191,6 +191,7 @@ _WRITE_VDP_DATA:: ;; Wait for VBL interrupt to be finished .wait_vbl_done:: _wait_vbl_done:: +_vsync:: ld a, (_shadow_VDP_R1) and #.R1_DISP_ON ret z
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.