Hi John! Just tried the new version of Torvin and Display256BMP works fine after LoadSpritePatterns command.
Thank you!
Hi!
Another test:
#INCLUDE <torvin_next_foundry.bas>
#INCLUDE <keys.bas>
#INCLUDE <torvin_vortexmusic.bas>
#INCLUDE <torvin_aysfx.bas>
CONST FONT_BANK AS UBYTE = 34
CONST DRIVER_BANK AS UBYTE = 36
CONST MUSIC_BANK AS UBYTE = 37
CONST SFX_BANK AS UBYTE = 39
const sprite_bank as ubyte = 50
Init()
Main()
STOP
SUB Init()
LoadToBanks("ASSETS/font256_1.spr",FONT_BANK,0)
LoadToBanks("ASSETS/ts4000.bin",DRIVER_BANK,0)
LoadToBanks("ASSETS/TestMusic.pt3",MUSIC_BANK,0)
LoadToBanks("ASSETS/gameSFX.afb",SFX_BANK,0)
LoadToBanks("ASSETS/cubo.spr",sprite_bank,0) '<---- add a spr file
END SUB
' ============================================================================================
' Main Control Loop
' ============================================================================================
SUB Main()
DIM sKeyReleased AS UBYTE
dim scrollamount as ubyte
Music_Init(DRIVER_BANK, MUSIC_BANK)
SFX_Init(SFX_BANK)
Layer256On(1,0)
Music_Start()
SpritesOn()
'LoadSpritePatterns(64,0,sprite_bank,0) '<------ is the problem here?
InitSmallSprite(0,100,100,1)
Display256BMP("ASSETS/prueba.bmp")
DO
scrollamount=scrollamount+1
ScrollLayer256(scrollamount,0)
WaitScanLine(192)
Music_PlayFrame()
SFX_PlayFrame()
LOOP
END SUBIf you run this example with the LoadSpritePatterns command uncommented the program freezes in the Display256BMP statement. I think that any Display256BMP command AFTER a LoadSpritePatterns results in a freeze.
Please, let me know if I can do something to help.
Thank you!
Hi John,
Just a quick example based on the code generated by the Foundry for a new standard program:
#INCLUDE <torvin_next_foundry.bas>
#INCLUDE <keys.bas>
#INCLUDE <torvin_vortexmusic.bas>
#INCLUDE <torvin_aysfx.bas>
CONST FONT_BANK AS UBYTE = 34
CONST DRIVER_BANK AS UBYTE = 36
CONST MUSIC_BANK AS UBYTE = 37
CONST SFX_BANK AS UBYTE = 39
const sprite_bank as ubyte = 50
Init()
Main()
STOP
SUB Init()
LoadToBanks("ASSETS/font256_1.spr",FONT_BANK,0)
LoadToBanks("ASSETS/ts4000.bin",DRIVER_BANK,0)
LoadToBanks("ASSETS/TestMusic.pt3",MUSIC_BANK,0)
LoadToBanks("ASSETS/gameSFX.afb",SFX_BANK,0)
LoadToBanks("ASSETS/cubo.spr",sprite_bank,0) '<---- add a spr file
END SUB
' ============================================================================================
' Main Control Loop
' ============================================================================================
SUB Main()
DIM sKeyReleased AS UBYTE
dim scrollamount as ubyte
Music_Init(DRIVER_BANK, MUSIC_BANK)
SFX_Init(SFX_BANK)
Layer256On(1,0)
Music_Start()
Display256BMP("ASSETS/prueba.bmp")
SpritesOn()
'LoadSpritePatterns(64,0,sprite_bank,0) '<------ is the problem here?
InitSmallSprite(0,100,100,1)
DO
if multikeys(KEYL) then
while multikeys(KEYL)
wend
Display256BMP("ASSETS/font256_1.bmp")
end if
scrollamount=scrollamount+1
ScrollLayer256(scrollamount,0)
WaitScanLine(192)
Music_PlayFrame()
SFX_PlayFrame()
LOOP
END SUB
While then program is running, if you press L key, it loads a new BMP and the scroll continues... but if you uncomment the
LoadSpritePatterns
line, when you press the L key, the program freezes...
I hope it helps. Please, let me know if I must do another example.
Best regards
Hi John!
Thanks for create and share Torvin Foundation.
I've been testing it for a few days now and I'm really enjoying it. Congratulations! I don't know if I've encountered a bug or if I'm doing something wrong, but if I load a BMP file with `Display256BMP()` and then load another one with the same function, the game freezes. The same thing happens if I use `Display256BMP()` after initializing the sprites with:
`SpritesOn()`
`LoadSpritePatterns(64,0,SPRITE_BANK,0)`
the game freezes.
I don't know if it's a bug and if there's an easy fix.
Thank you very much!
Supongo que ya lo sabes, pero si usas la versión 1.4.5, puedes ver los prototipos de las funciones en la carpeta /include. Además, en la carpeta /optional, está el código en sí de cada función. Otra posibilidad es descargar la documentación que han generado en el repositorio de la reimplementación de DragonBasic en: https://github.com/uli/dragonbasic/tree/master/dbapi
Por cierto, he intentado compilar el código de este repo varias veces y no he conseguido hacerlo... da un montón de problemas.
De este mismo repositorio puedes bajar algunos ejemplos (https://github.com/uli/dragonbasic/tree/master/examples) que, si no recuerdo mal, funcionan en DragonBasic 1.4.5 con pocas o ninguna modificación.
También en gbadev.org hay algunos ejemplos con código fuente, aunque la mayoría son de versiones anteriores (1.2 y 1.3) y los cambios que hay que hacer son bastante serios.
Estaría bien que hubiera algún tipo de servidor de Discord o algo así para comentar, aprender e intercambiar código.
Muchas gracias a ti por probarlo y comentar. Y sobre DragonBasic, la verdad es que en su día lo ignoré por completo y ahora que lo estoy probando me parece un lenguaje/compilador bastante potente, el único problema que le veo es que hay poca documentación y poca base de usuarios. En unos días subiré otro juego que estoy terminando hecho en DragonBasic, tipo Defender.
Saludos!
Hi! thanks for your comments. Yes, it a little bit harder than the original one, maybe for the game speed. Thanks for the bug report, I'll upload this weekend a version with it fixed. Regarding the color palette, I'll try include it. I must to study how to do it as I don't know well how color palettes work in GBC.
Thank you!