Flood (game) - issues with d64

Discussion, Reviews & High-scores

Moderator: Moderators

Post Reply
User avatar
javierglez
Vic 20 Hobbyist
Posts: 107
Joined: Sat Jun 03, 2017 3:33 pm

Flood (game) - issues with d64

Post by javierglez »

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.
Attachments
flood_d64.zip
(19.29 KiB) Downloaded 128 times
User avatar
javierglez
Vic 20 Hobbyist
Posts: 107
Joined: Sat Jun 03, 2017 3:33 pm

Re: Flood (game) - issues with d64

Post by javierglez »

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.
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Flood (game) - issues with d64

Post by nbla000 »

The problem is, when I launch it off a d64 from the filebrowser with SD2IEC, it starts, but after some time it freezes.
Do you mean my CBM-FileBrowser "FB20-8K" in your case? right?
It may have something to do with memory inicialization, and not with SD2IEC.
Talking about my CBM-FileBrowser it uses stantard kernal locations except some temp bytes in these locations:

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
In any case I've tried to reset these values before RUN but this didn't solved the problem, I will investigate further.

PS: I've noticed that the game is not centered for NTSC machines.
Mega-Cart: the cartridge you plug in once and for all.
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Flood (game) - issues with d64

Post by nbla000 »

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.
User avatar
javierglez
Vic 20 Hobbyist
Posts: 107
Joined: Sat Jun 03, 2017 3:33 pm

Re: Flood (game) - issues with d64

Post by javierglez »

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:

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 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)
User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Re: Flood (game) - issues with d64

Post by srowe »

You should at least check the carry bit after each LOADSP call, Cb=1 indicates an error.
User avatar
javierglez
Vic 20 Hobbyist
Posts: 107
Joined: Sat Jun 03, 2017 3:33 pm

Re: Flood (game) - issues with d64

Post by javierglez »

srowe wrote: Thu Feb 03, 2022 2:32 pm You should at least check the carry bit after each LOADSP call, Cb=1 indicates an error.
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
User avatar
javierglez
Vic 20 Hobbyist
Posts: 107
Joined: Sat Jun 03, 2017 3:33 pm

Re: Flood (game) - issues with d64

Post by javierglez »

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
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Flood (game) - issues with d64

Post by nbla000 »

Thanks for checking the program nbla.
Your welcome, I like debug sessions :wink:
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'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.
Mega-Cart: the cartridge you plug in once and for all.
User avatar
javierglez
Vic 20 Hobbyist
Posts: 107
Joined: Sat Jun 03, 2017 3:33 pm

Re: Flood (game) - issues with d64

Post by javierglez »

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.
User avatar
javierglez
Vic 20 Hobbyist
Posts: 107
Joined: Sat Jun 03, 2017 3:33 pm

Re: Flood (game) - issues with d64

Post by javierglez »

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.
floodvic.zip
(31.06 KiB) Downloaded 94 times
flood_grafs_sc1-2.jpg
User avatar
javierglez
Vic 20 Hobbyist
Posts: 107
Joined: Sat Jun 03, 2017 3:33 pm

Re: Flood (game) - issues with d64

Post by javierglez »

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
User avatar
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

Post by chysn »

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
User avatar
javierglez
Vic 20 Hobbyist
Posts: 107
Joined: Sat Jun 03, 2017 3:33 pm

Re: Flood (game) - issues with d64

Post by javierglez »

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
Post Reply