Lady Bug

developing/porting a new game or gaming framework? post in here!
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

oh I found a mistake, a few builds back i was playing around with the draw priority of things and forgot to put the center vegetable back to where it was before (drawn before sprites so that its under lady bug when collected)

ive fixed that mistake sorry guys

i also modified the filelocker to break out of the inner loop once a file is found as theres no point to keep looking through the whole sector for the same file name

i also added display of the file name and its status "locked" or "not found"

Code: Select all

LadyBug.ssd locking files
!Boot  $ locked
Boot   $ locked
[Maze1]$ locked
[Maze2]$ locked
[Maze3]$ locked
Loader $ locked
LadyBug$ locked
Reset  $ locked
[ConfR]$ locked
Editor $ locked
EditorM$ locked
EditorT$ locked
so heres the final final build again :lol:

Build 003321 Final
 
LadyBug.ssd
(50.25 KiB) Downloaded 15 times
 
source.zip
(701.02 KiB) Downloaded 6 times
Image Image Image Image
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Lady Bug

Post by lovebug »

heh I found another bug in the game but probably wont fix it, i cant keep making final versions :P

I created a maze with no dots, when the game starts lady bug is stuck in the bottom corner, the sound goes crazy, you cannot move, the enemy timer is frozen and no enemys will be released

its this end of level check thats called from the main game loop

Code: Select all

.checkLevelEnd

	lda levelEnd				; if level not ended
	bne checkLevelEndTrue

	lda levelEdibles			; if theres still edible objects then exit
	bne checkLevelEndExit
	
	lda #endLevelTime			; pause ladybug and enemies
	sta pauseLadybug
	sta pauseEnemy

	....
no dots = no edible items so this function pauses lady bug and the enemies
the walk on animation for lady bug cannot move because of this and the game is stuck forever :D

so just remember guys if youre making maps that you need a minimum of 1 dot :lol:
Last edited by lovebug on Sat Aug 06, 2022 7:26 pm, edited 5 times in total.
Image Image Image Image
User avatar
tricky
Posts: 6494
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Lady Bug

Post by tricky »

Seems like a reasonable way of reporting "illegal maze" ;)
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

tricky wrote:
Sat Aug 06, 2022 12:15 pm
Seems like a reasonable way of reporting "illegal maze" ;)
yeah :D :D :D
Image Image Image Image
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

erm you know i cant let it go :roll: I had to fix the no dots maze issue so now theres a test in .gameLevelStart that checks if there are no edible objects and then jumps straight to game over which is better than that glitchy mess

Code: Select all

;-----------------------------------------------------------------------------------------------------------------------------------------------------
; setup current level ready for play
;-----------------------------------------------------------------------------------------------------------------------------------------------------

.gameLevelStart

	jsr initLevelSettings			; setup skulls, letters, enemy settings etc for current level

	jsr drawPlayfieldUpper			; draw playfield upper section (top bonus panel)

	jsr drawPlayfieldLower			; draw playfield lower section (info panel)

	jsr drawLevelIntro			; draw the level intro screen

	jsr initPlayfieldMiddle			; initialize playfield middle section tileMap and count number of dots

	lda levelEdibles			; if user created a maze with with no edible objects
	bne gameLevelRestart
	jmp gameOver				; then end the game

Build 003322 Final Final Final !!!
 
LadyBug.ssd
(50.25 KiB) Downloaded 1 time
 
source.zip
(701.14 KiB) Downloaded 1 time
Image Image Image Image
User avatar
tricky
Posts: 6494
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Lady Bug

Post by tricky »

We knew, and appreciate you all the more for it :)
User avatar
leenew
Posts: 4804
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Lady Bug

Post by leenew »

Lol :lol:
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

I found a serious bug that really did need fixing, recently I changed some file names [Maze1] [Maze2] [Maze3] [Conf] [ConfR] [Maps]
and made changes to the basic programs but I missed one in reset.bas [Maps]

resetting the maps to default causes the names to be written to the old file "Maps" making resetting the maps impossible except for loading the original maze files in the editor

fixed

Build 003323 final final final final ? :lol:
 
LadyBug.ssd
(50.25 KiB) Downloaded 10 times
 
source.zip
(701.14 KiB) Downloaded 2 times
Image Image Image Image
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

special thanks to lurkio for updating bbcmicro.co.uk with my latest build (again)
Image Image Image Image
User avatar
lurkio
Posts: 4184
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Lady Bug

Post by lurkio »

lovebug wrote:
Mon Aug 08, 2022 4:29 pm
special thanks to lurkio for updating bbcmicro.co.uk with my latest build (again)
Wasn’t me this time! It was Lee.

:idea:
User avatar
leenew
Posts: 4804
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Lady Bug

Post by leenew »

Yeah, we split the work. It's a full-time job for two people keeping it updated :lol:

Lee
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

thanks guys, sorry for the many many updates
Image Image Image Image
User avatar
leenew
Posts: 4804
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Lady Bug

Post by leenew »

It's not a problem! I was just having a little joke :wink:

Lee.
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

oh the disk image at http://bbcmicro.co.uk/gameimg/discs/399 ... ugRSTD.ssd is not my original and my loader looks messed up again :lol:

also i made this disk so that it can be copied to an adfs disk sub directory if needed but the close#0's youve added will cause a channel on channel error

sorry im a pain :oops:
Image Image Image Image
User avatar
leenew
Posts: 4804
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Lady Bug

Post by leenew »

lovebug wrote:
Wed Aug 10, 2022 1:49 pm
oh the disk image at http://bbcmicro.co.uk/gameimg/discs/399 ... ugRSTD.ssd is not my original and my loader looks messed up again :lol:

also i made this disk so that it can be copied to an adfs disk sub directory if needed but the close#0's youve added will cause a channel on channel error

sorry im a pain :oops:
Hi,
We have a utility that splits games from Mick's 18 game DSDs into individual SSDs and creates a custom loader for the website.
I have now over-written this with your original disc image.

Hope this helps.

Lee.
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

ah thanks matey :D too kind
Image Image Image Image
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

I've found a really strange bug that I think is caused by the bad maze timeout function causing corruption of some enemy sprites

Its very strange, I need to see why data is getting written and why into the sprite area (possibly other places too)

before the timeout was added the game used to just stay in an infinite loop looking for places for objects that it never could find so this sprite glitch bug never happened

heres a video showing the sprite corruption which seems to start with enemy 3 (level 3)

Image Image Image Image
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

ive not had a lot of spare time but i checked the three functions .placeTileMapHearts .placeTileMapLetters .placeTileMapSkulls and they are all functioning correctly, I then commented out the calls to these three and ran the game with the regular mazes and the sprites corrupted !

so for some reason not placing the objects in the map is causing this but im still investigating...
Image Image Image Image
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

Last night I tested 002977 with the three functions commented out and it doesnt suffer with this sprite glitch issue which is great news, i'll work my way up the build numbers until the sprite error is triggered and see what change was made
Image Image Image Image
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

ive gone through the builds that I have backups and found that 003021 is good and 003023 has the glitch

if i have time tonight i'll diff them and see what I screwed up, i have a feeling its something to do with the end of level sound ! just a feeling
Image Image Image Image
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

i did a quick diff and the only difference between 003021 and 003023 is that i removed the sprite out of bounds checking code because sprites no longer can go out of the main arena

investigating.... (tonight)
Image Image Image Image
User avatar
tricky
Posts: 6494
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Lady Bug

Post by tricky »

Do you have "data breakpoints" in your debugger?
Ones that stop when an address is written to?
I added them to my local beebem, but I think b-em might already have then, as does MAME.
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

tricky wrote:
Sat Aug 13, 2022 11:49 am
Do you have "data breakpoints" in your debugger?
Ones that stop when an address is written to?
I added them to my local beebem, but I think b-em might already have then, as does MAME.
i was looking through beebem for a break on write to address but it doesnt seem to have that

i'll try b-em

or maybe you could give me a copy of your beebem [-o<

do you have your build on github ?
Image Image Image Image
User avatar
tricky
Posts: 6494
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Lady Bug

Post by tricky »

My exe is here: https://www.dropbox.com/s/udx9put74kwuf ... m.zip?dl=0 but it was installed with an ancient installer, so I don't know if it will just run!
The Src directory is here: https://www.dropbox.com/s/5zwguz0v80i6z ... c.zip?dl=0 but I haven't tested if it needs anything else.
The project is VS2019 and Platform Toolset: 2013 - Windows XP v120_xp but it should work on other versions.
BeebEmNewOptions.png
I've also added a few other bits, some of which have been added to main.
I only use local Perforce for source and asset control and have done ever since we got it for my last work ~20 years ago.
My usual command line would look something like:

Code: Select all

TrickycadeTileGame.ssd -debugger -labels labels.txt -labels rom_labels.txt -debugging debug.dbg
"-debugger" start with the debugger open.
"-labels labels.txt" loads the additional labels from labels.txt and is then used again to load more labels.
"-debugging debug.dbg" loads and saves the breakpoint, data breakpoint and watch window contents for next time.
The addresses should auto update from one run to another, but it may not always get it right.

If your code looks like:

Code: Select all

.main_game
{
.main_loop
}
then you can add a breakpoint for .main_loop with: db .main_game.main_loop assuming that is how they were exported from your assembler (I always use beebasm, but seem to remember that you don't). if you enter and address, it may convert it to .label+7 and next time it should look up label and add 7 but it won't know if you have changed the code after .label so it may miss your breakpoint.
There are some additional formats for the Watches window:
t - triple, three byte integer.
W - memory[0].memory[2]
T - memory[0].memory[2].memory[4]
D - memory[0].memory[2].memory[4].memory[6]
I haven't used these since I wrote them, so may not be 100%

In general, I hack something in for a specific problem and then may remove it, leave it to rot or tidy it up a bit as a feature!

PS Live Redraw can take 20 seconds on my PC to render the screen when first turned on and the UI will become unresponsive. After that, every write to what was screen memory last frame is drawn as it happens. If I see something drawing incorrectly, I will often turn this on and then press break when the dodgy bit is being drawn to see which code it is doing the drawing.

The uninitialised feature was for when the PC was going off out of the code.

The data break point is quite good for screen corruption that is too quick to catch with Live Redraw.

Most of these features are available in MAME where they can be scripted and combined, not that I have ever used MAME to debug beeb code but I have sometimes when porting an arcade game.
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

thank you so much for this and the time it must have taken writing the explaination and diagrams

so helpful \:D/
Image Image Image Image
User avatar
tricky
Posts: 6494
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Lady Bug

Post by tricky »

There seems to be a bug in this version of beebem that hits much quicker when recording a video.
It seems that sound events get queued up but not serviced as they have missed their chance!

Code: Select all

void Sound_RegWrite(int value)
{
	const int read_cycle = (TotalCycles + Cycles - LastBeebCycle) / 16; // ~ read every 16 clock
	if (!sn76489.upd_count || read_cycle != sn76489.upd_times[sn76489.upd_count - 1])
	{
		sn76489.upd_times[sn76489.upd_count++] = read_cycle;
	}
	sn76489.upd_write[sn76489.upd_count - 1] = value;
}

void Sound_RegWriteOff()
{
	const int read_cycle = (TotalCycles + Cycles - LastBeebCycle) / 16; // ~ read every 16 clock
	if (sn76489.upd_count && read_cycle == sn76489.upd_times[sn76489.upd_count - 1])
	{
		--sn76489.upd_count;
	}
}
I also haven't looked closely but it seems that sound events are queued up but then only the last one can ever get serviced and that gets missed because the sound chip cycle (cycle / 16) that it tries to service has just gone!
User avatar
tricky
Posts: 6494
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Lady Bug

Post by tricky »

Doh!
found it, if you turn the sound off, the sound events keep getting added to a buffer, but never serviced, so it just scribbles off into memory.
I'll add a fix, but just not turning the sound off should work!

PS It can still happen if this version of beebem gets too far behind, like when exporting video with the speed turned up.

PPS This version also supports the timing to make the speech chip work with Computer Concepts ROMs and my games and demos :)
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

Build 003330 - its finally fixed and its the final version again :D
 
ladybug-90x90.png
ladybug-90x90.png (9.52 KiB) Viewed 99 times
 
LadyBug.ssd
(50.5 KiB) Downloaded 6 times
 
source.zip
(700.88 KiB) Downloaded 1 time
 
oh yeah also
in ladybug.asm I replaced some hard coded vegetable values with named constants, renamed some function, renamed some variables and changed some comments
in constants.asm i added the vegetable names
in variables.asm i renamed some variables
in boot.bas i changed the wait for return key to wait for any key and added some color to the editor keys instructions

 
 
thanks tricky, I couldnt actually get your beebem to work (i was tired) im sorry :( I will revisit your code when im up to it

b-em allowed breakpoint on memory write but not to an address range and setting up a load of individual addresses was not something that I fancied doing (again maybe i was too tired and it could do it ?)

I went for just setting break points in the game with beebem and then peeking memory to see whats what

it was a tough one to find

tracked the problem down to the function .updatePauseTimers !!!! , theres a bit of code in there that erases an object score from the screen once ladybug is unpaused after collecting an object but due to an oversight it was also erasing an object score even when one wasnt required

as ladybug is paused at the end of the level and then unpaused for the next level this was triggering an object score erase to an uninitialized pointer and corrupting the game

this bug has been in the code forever but was masked by both the original out of bounds drawing protection (which was removed 300 builds back) and a normal maze which usually contains the hearts letters objects which leaves a valid address once its been collected

fixed it by testing if objectScoreImg == 0 (no object) then skip over the erase code

Code: Select all

	lda objectScoreImg			; if there is currently an object score being displayed
	beq updatePauseTimersVegetableScore

	lda #0					; then disable it
	sta objectScoreImg

	lda objectScoreX			; and erase it from screen
	sta drawSpriteX
	lda objectScoreY
	sec
	sbc #2
	sta drawSpriteY
	jsr eraseBlock

	;---------------------------------------------------------------------------------------------------------------------------------------------

.updatePauseTimersVegetableScore
 
Last edited by lovebug on Thu Aug 18, 2022 9:44 am, edited 13 times in total.
Image Image Image Image
User avatar
tricky
Posts: 6494
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Lady Bug

Post by tricky »

It probably needs to be a 64 bit build if you have a recent OS, I'll see if I can build one out of curiosity ;)
Sorry it wasn't any help and probably cost valuable time, but glad you have found your bug =D>
User avatar
lovebug
Posts: 1219
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Lady Bug

Post by lovebug »

thanks tricky

i wish i could have got your beebem working, i will look into it again when my mind is fresh and i have more energy

btw i use windows 7 pro 64 bit
Last edited by lovebug on Thu Aug 18, 2022 9:19 am, edited 1 time in total.
Image Image Image Image
Post Reply

Return to “new projects in development: games”