Flood (game) - issues with d64
Moderator: Moderators
- javierglez
- Vic 20 Hobbyist
- Posts: 108
- Joined: Sat Jun 03, 2017 3:33 pm
Flood (game) - issues with d64
This is about the new game I made. The problem is, when I launch it off a d64 from the filebrowser with SD2IEC, it starts, but after some time it freezes.
So in the releases thread I have attached a folder to copy to the SD card and then the filebrowser launches the game correctly. I don't know if this way around works for "TheVIC20".
The thing is, I'd like to fix this issue. My game loads the different levels from disk and use SETLFS, SETNAM and LOAD kernal routines. I don't know how to debug. I guess the filebrowser does some changes in the lower 1kB that my code doesn't like.
So in the releases thread I have attached a folder to copy to the SD card and then the filebrowser launches the game correctly. I don't know if this way around works for "TheVIC20".
The thing is, I'd like to fix this issue. My game loads the different levels from disk and use SETLFS, SETNAM and LOAD kernal routines. I don't know how to debug. I guess the filebrowser does some changes in the lower 1kB that my code doesn't like.
- Attachments
-
- flood_d64.zip
- (19.29 KiB) Downloaded 171 times
- javierglez
- Vic 20 Hobbyist
- Posts: 108
- Joined: Sat Jun 03, 2017 3:33 pm
Re: Flood (game) - issues with d64
It may have something to do with memory inicialization, and not with SD2IEC. I'll try to configure the emulator not to fill the memory with zeros. I have pretty much the same program converted to run on a C16 and it has some errors too. But for C16 it makes no difference if it's a folder or a disk image. If I reset the computer, eventually the game seems to run.
Re: Flood (game) - issues with d64
Do you mean my CBM-FileBrowser "FB20-8K" in your case? right?The problem is, when I launch it off a d64 from the filebrowser with SD2IEC, it starts, but after some time it freezes.
Talking about my CBM-FileBrowser it uses stantard kernal locations except some temp bytes in these locations:It may have something to do with memory inicialization, and not with SD2IEC.
Code: Select all
0022-0025 34-37 Utility pointer area
0026-002A 38-42 Product area for multiplication
0057-0060 87-96 Misc numeric work area
00FB-00FE 251-254 Operating system free zero page space
PS: I've noticed that the game is not centered for NTSC machines.
Mega-Cart: the cartridge you plug in once and for all.
Re: Flood (game) - issues with d64
OK, the problem is the tape buffer ($33C-$3FF), you should initialize/clean this area at startup since it could contain any kind of data even if you don't use CBM-FileBrowser.
Mega-Cart: the cartridge you plug in once and for all.
- javierglez
- Vic 20 Hobbyist
- Posts: 108
- Joined: Sat Jun 03, 2017 3:33 pm
Re: Flood (game) - issues with d64
Thanks for checking the program nbla.
I'll check the NTSC screen margin values with VICE. It detects if PAL/NTSC with
lda $EDE4
cmp #$C
I found a bug in the hi-score update BTW.
I'm not suspicious of filebrowser, it's just that I use it to mount the d64 image and to change folders in general.
I burned the image to a real floppy and the game didn't freeze, but had a minor graphical glitch at level 5.
I think I don't use the kernal routines properly. Although I have no idea why I have different results with the emulator, the real floppies and the SD2IEC. (edit: The results are consistent)
I use, to load the graphics file and to load the level file:
I have a C16 version too, doesn't freeze but has more glitches. I'll try to do some debugging, as it has the MC monitor embedded. But I've never done this.
(I think Chysn or somebody else put a link to the kernel disassembly but I can't find the thread. I should check what LOADSP does OK I found it:http://www.fox-ts.co.uk/shared/vic20ker ... l#LAB_F542)
I'll check the NTSC screen margin values with VICE. It detects if PAL/NTSC with
lda $EDE4
cmp #$C
I found a bug in the hi-score update BTW.
I'm not suspicious of filebrowser, it's just that I use it to mount the d64 image and to change folders in general.
I burned the image to a real floppy and the game didn't freeze, but had a minor graphical glitch at level 5.
I think I don't use the kernal routines properly. Although I have no idea why I have different results with the emulator, the real floppies and the SD2IEC. (edit: The results are consistent)
I use, to load the graphics file and to load the level file:
Code: Select all
nexdaca
ldx #<nextfilechar ; <-pointers to file names
ldy #>nextfilechar
jsr loadbin
ldx #<nextfilemap
ldy #>nextfilemap
jsr loadbin
jmp sigjuego
loadbin
stx addrlo
sty addrhi
ldx #8 ; device number
ldy #1 ; direccion secundaria, 0 para relocalizar si LOADSP, diferente cargar en su direccion
jsr SETLFS
lda #filenamelength
ldx addrlo
ldy addrhi
jsr SETNAMS
lda #0 ; indica carga 1 indicaria verificacuon
jsr LOADSP
rts
(I think Chysn or somebody else put a link to the kernel disassembly but I can't find the thread. I should check what LOADSP does OK I found it:http://www.fox-ts.co.uk/shared/vic20ker ... l#LAB_F542)
Re: Flood (game) - issues with d64
You should at least check the carry bit after each LOADSP call, Cb=1 indicates an error.
- javierglez
- Vic 20 Hobbyist
- Posts: 108
- Joined: Sat Jun 03, 2017 3:33 pm
Re: Flood (game) - issues with d64
If it doesn't load some data (some file), the current data remains, the game doesn't make sense anymore, but it doesn't crash.
It could only be an issue if a file is corrupt, but then the issues when running wouldn't be consistent.
After all it's a game not a utility.
It may be my sound interrupt interfering with the loading
- javierglez
- Vic 20 Hobbyist
- Posts: 108
- Joined: Sat Jun 03, 2017 3:33 pm
Re: Flood (game) - issues with d64
Maybe I should remove the release until I fix it. I didn't suspect it would run in the emulator but not in the real machine
Re: Flood (game) - issues with d64
Your welcome, I like debug sessionsThanks for checking the program nbla.
I'm really happy that many people use my CBM-FileBrowser on their CBM machine, there will be a new 1.7 version (currently in beta testing) for pi1541 compatibility and few additional features.I'm not suspicious of filebrowser, it's just that I use it to mount the d64 image and to change folders in general.
Mega-Cart: the cartridge you plug in once and for all.
- javierglez
- Vic 20 Hobbyist
- Posts: 108
- Joined: Sat Jun 03, 2017 3:33 pm
Re: Flood (game) - issues with d64
OK it definitely had to do with the tape buffer, although I aim to initialize all the variables, some weren't.
With regards to the disk error checking (I use a nonexistant filename to skip updating graphics), SD2IEC requires clearing the error channel before attemping to load a file again, so I added code to read the error channel.
It is being somewhat interesting to debug with the C16 and the embedded monitor.
I hope to have the program fixed in a few days.
With regards to the disk error checking (I use a nonexistant filename to skip updating graphics), SD2IEC requires clearing the error channel before attemping to load a file again, so I added code to read the error channel.
It is being somewhat interesting to debug with the C16 and the embedded monitor.
I hope to have the program fixed in a few days.
- javierglez
- Vic 20 Hobbyist
- Posts: 108
- Joined: Sat Jun 03, 2017 3:33 pm
Re: Flood (game) - issues with d64
I finally fixed the initialization bugs and modified a little bit the player's control and changed the random generator for a pseudo random generator. I'm going to leave it here for a while anyway before releasing.
- javierglez
- Vic 20 Hobbyist
- Posts: 108
- Joined: Sat Jun 03, 2017 3:33 pm
Re: Flood (game) - issues with d64
I changed a couple of things at the suggestion of Luca from the C16 forum and posted an updaded version on the 2022 releases thread
- chysn
- Vic 20 Scientist
- Posts: 1205
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: Flood (game) - issues with d64
Very nicely done, looks sharp! My high score is in the 5000 range so far.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5
WIP: MIDIcast BASIC extension
he/him/his
WIP: MIDIcast BASIC extension
he/him/his
- javierglez
- Vic 20 Hobbyist
- Posts: 108
- Joined: Sat Jun 03, 2017 3:33 pm
Re: Flood (game) - issues with d64
Thank you Chysn.
There's a combination of 2 keys that, when pressed simulataneously, the current level is skipped, but then you don't get the points ofc. But I'll keep as a secret for the moment
There's a combination of 2 keys that, when pressed simulataneously, the current level is skipped, but then you don't get the points ofc. But I'll keep as a secret for the moment