chrismaltby / gb-studio

A quick and easy to use drag and drop retro game creator for your favourite handheld video game system
https://www.gbstudio.dev
MIT License
8.3k stars 467 forks source link

Compilation broken in example projects #1473

Open lbernalsierra opened 2 days ago

lbernalsierra commented 2 days ago

I have been developing my project for months without problem in 3.2.1 version. I got a strange error, I tried to fix it by installing version 4.0. But it does not even compile the example projects. I have even tried creating an empty project but it doesn't work. I have returned to 3.2 and the problem persists, completely uninstalled... I have returned to 4.0 and no. The error continues even in new projects using the ex!

image

CONSOLE: Preparing variables... Preparing images... Preparing tilesets... Preparing ui... Preparing sprites... Preparing avatars... Preparing emotes... Preparing music... Preparing fonts... Preparing scenes... Preparation complete Compiling events... Unlink _gbsbuild Copy default engine Looking for local engine in assets/engine Local engine not found, using default engine Looking for engine plugins in plugins/*/engine Validating build files... Compilando: src\core\absolute.c Compilando: src\core\actor.c Compilando: src\core\bankdata.c Compilando: src\core\bootstrap.s Compilando: src\core\camera.c Compilando: src\core\core.c Compilando: src\core\crash_handler.s Compilando: src\core\data_manager.c Compilando: src\core\events.c Compilando: src\core\fade_manager.c Compilando: src\core\flasher_s.s Compilando: src\core\flasher.c Compilando: src\core\game_time.c Compilando: src\core\gbprinter.c Compilando: src\core\input.c Compilando: src\core\interrupt_sio.s Compilando: src\core\interrupt_timer.s Compilando: src\core\interrupts.c Compilando: src\core\load_save.c Compilando: src\core\math_atan2.c Compilando: src\core\math.c Compilando: src\core\music_manager.c Compilando: src\core\palette.c Compilando: src\core\parallax.c Compilando: src\core\projectiles.c Compilando: src\core\scroll_a.s Compilando: src\core\scroll.c Compilando: src\core\set_tile_submap.s Compilando: src\core\sfx_player.c Compilando: src\core\sgb_border.c Compilando: src\core\sio.c Compilando: src\core\states_caller.s Compilando: src\core\system.c Compilando: src\core\trigger.c Compilando: src\core\ui_a.s Compilando: src\core\ui.c src\core\data_manager.c:108: error 20: Undefined identifier 'image_widthh' Compilando: src\core\vm_actor.c Compilando: src\core\vm_camera.c Compilando: src\core\vm_gameboy.c Compilando: src\core\vm_gbprinter.c Compilando: src\core\vm_instructions.c Compilando: src\core\vm_load_save.c Compilando: src\core\vm_math.c Compilando: src\core\vm_music.c Compilando: src\core\vm_palette.c Compilando: src\core\vm_projectiles.c Compilando: src\core\vm_rtc.c Compilando: src\core\vm_scene.c Compilando: src\core\vm_sgb.c Compilando: src\core\vm_sio.c Compilando: src\core\vm_ui_a.s Compilando: src\core\vm_ui.c Compilando: src\core\vm.c Compilando: src\data\bg_placeholder_tilemap.c Compilando: src\data\bg_placeholder_tileset.c internal error: same peephole restriction malformed: %2 'ix Compilando: src\data\bg_placeholder.c Compilando: src\data\cursor_image.c Compilando: src\data\font_gbs_mono.c Compilando: src\data\frame_image.c Compilando: src\data\game_signature.c Compilando: src\data\palette_0.c Compilando: src\data\palette_1.c internal error: same peephole restriction malformed: %1 'ix internal error: same peephole restriction malformed: %2 'ix Compilando: src\data\scene_1_collisions.c Compilando: src\data\scene_1_init.s Compilando: src\data\scene_1.c Compilando: src\data\script_engine_init.s Compilando: src\data\sprite_actor_animated_tileset.c Compilando: src\data\sprite_actor_animated.c Compilando: src\data\spritesheet_none.c Compilando: src\main.c Compilando: src\states\adventure.c Compilando: src\states\logo.c Compilando: src\states\platform.c Compilando: src\states\pointnclick.c Compilando: src\states\shmup.c Compilando: src\states\states_ptrs.s Compilando: src\states\topdown.c internal error: notUsed peephole restriction requires operand(s): 'hl *** internal error: notUsed peephole restriction requires operand(s): 'hl src\core\actor.c:19: fatal error: when writing output to : Broken pipe 19

compilation terminated. removing obj\vm_gameboy.o obj\vm_gameboy.asm:395: Error: missing or improper operators, terminators, or delimiters internal error: same peephole restriction malformed: %2 'ix internal error: same peephole restriction malformed: %1 'ix

Warnings:

chrismaltby commented 2 days ago

Hi @lbernalsierra that's very odd...

Here's a few things you could try:

  1. Empty the build cache by going to the "Build Log" and clicking "Build Options / Empty Build Cache"

    Screenshot 2024-07-02 at 17 17 33
  2. Try changing the application's Temp directory to another location that you can write to

    Screenshot 2024-07-02 at 17 19 49
  3. Within the temp directory try deleting _gbsbuild, _gbscache and _gbstools folders. When switching back to GB Studio 3.2 it should be deleting the _gbstools folder automatically and replacing it with a version containing the old compiler, but maybe there's some permissions on those folders preventing them from being deleted

  4. Could you try going to Game -> Advanced -> Export Project Source in the menu and zipping up / uploading the folder it creates here? I'm very interested in what's going on with the error you includedsrc\core\data_manager.c:108: error 20: Undefined identifier 'image_widthh'. In the code that line should be appearing as scroll_x_max = image_width - ((UINT16)SCREENWIDTH); without two "h"'s https://github.com/chrismaltby/gb-studio/blob/82d3c18378e528dd9c379c82534d9bf3a0cf8a43/appData/src/gb/src/core/data_manager.c#L108

Let me know if any of these things help, definitely interested in understanding what's happening for you here