If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Notes:Bubba 'n' Stix (Genesis)

From The Cutting Room Floor
Jump to navigation Jump to search

This page contains notes for the game Bubba 'n' Stix (Genesis).

Useful memory addresses

Presented as a BizHawk memory watch file. A small handful of them don't seem to have any effect when you change them (e.g. terrain collision flags), while others do make a change, but you won't really see it graphically (e.g. health).

SystemID GEN
00BA90	w	b	1	68K RAM	Controller
00C4B5	w	u	1	68K RAM	Selected menu
00C4B3	w	u	1	68K RAM	Selected sub-menu
00C531	w	u	1	68K RAM	Selected options BGM
00C533	w	u	1	68K RAM	Selected options SFX
00C4D2	d	h	1	68K RAM	Password part 1
00C4D6	d	h	1	68K RAM	Password part 2
00C4DA	w	h	1	68K RAM	Password part 3
0	S	_	1		
00C480	w	u	1	68K RAM	Current level
00C47C	d	h	1	68K RAM	Score
00F6BC	w	u	1	68K RAM	Continues
00C482	w	u	1	68K RAM	Lives
00C484	w	u	1	68K RAM	Health
00C65C	w	u	1	68K RAM	I-frames
00C486	d	3	1	68K RAM	Air
00C48A	w	h	1	68K RAM	HUD face
00C5A8	w	u	1	68K RAM	Time till idle anim
00F64A	w	u	1	68K RAM	Bonus level time
00CCFA	w	u	1	68K RAM	Boss health
0	S	_	1		
00C580	d	3	1	68K RAM	X last frame
00C584	d	3	1	68K RAM	Y last frame
00C612	d	3	1	68K RAM	X
00C616	d	3	1	68K RAM	Y
00C5C6	d	3	1	68K RAM	Speed X
00C658	b	b	1	68K RAM	Terrain collision direction flags
00C689	b	h	1	68K RAM	Is hugging wall
00C68D	b	h	1	68K RAM	Is hugging wall
00BABC	d	3	1	68K RAM	Death respawn X
00BAC0	d	3	1	68K RAM	Death respawn Y
0	S	_	1		
00BAD0	d	3	1	68K RAM	Cam X last frame
00BAD4	d	3	1	68K RAM	Cam Y last frame
00BAC8	d	3	1	68K RAM	Cam X
00BACC	d	3	1	68K RAM	Cam Y
00BAE8	d	3	1	68K RAM	Cam speed X
00BAEC	d	3	1	68K RAM	Cam speed Y
0	S	_	1		
00BAE4	d	3	1	68K RAM	Cam Y?
00BB20	d	3	1	68K RAM	Cam Y scroll?
00BB24	d	3	1	68K RAM	Cam Y something?
00BADC	d	3	1	68K RAM	Cam X something?
00BB0C	w	u	1	68K RAM	Cam X refresh something
00BB0E	w	u	1	68K RAM	Cam X refresh col
00B8C8	d	3	1	68K RAM	Cam absolute speed X?
00B8C4	d	3	1	68K RAM	Absolute speed X ratio
00B8CC	d	3	1	68K RAM	Camera + movement thing


(Source: Espyo)

Semi free-move script

Presented as a Lua script for emulators like Gens. Hold X and press a direction to move in that direction. It's highly recommended to pause the game and move while the game is paused. Note that the camera will not catch up (horizontally) unless you walk left or right, or (vertically) unless you jump or fall, meaning some places may be impossible to see if you can't move in them.

There is also some code in the script to move the camera alongside Bubba, but it's fairly glitchy, so it's commented out. Y toggles screenshot dumping, which I used to make some maps to help me navigate.

SHOW_COORDS = true
MOVE_CAM = false

X_ADDR = 0xFFC612
Y_ADDR = 0xFFC616
CAM_X_ADDR = 0xFFBAC8
CAM_Y_ADDR = 0xFFBACC
X_LAST_FRAME_ADDR = 0xFFC580
Y_LAST_FRAME_ADDR = 0xFFC584
CAM_X_LAST_FRAME_ADDR = 0xFFBAD0
CAM_Y_LAST_FRAME_ADDR = 0xFFBAD4
MOVE_AMOUNT = 6

take_screenshots = false
y_pressed = false

rendered_frame_x = memory.readword(X_ADDR)
rendered_frame_y = memory.readword(Y_ADDR)
rendered_frame_cam_x = memory.readword(CAM_X_ADDR)
rendered_frame_cam_y = memory.readword(CAM_Y_ADDR)

gui.register( function ()

    -- Coordinate drawing.
    -- It works a lot better when you make use of the memory addresses dubbed
    -- the "last frame" coordinates.
    if SHOW_COORDS then
        message = string.format("Pos: %d, %d", rendered_frame_x, rendered_frame_y)
        gui.text(8, 0, message, "#FFFF00FF", "black")
        message = string.format("Cam: %d, %d", rendered_frame_cam_x, rendered_frame_cam_y)
        gui.text(8, 12, message, "#FFFF00FF", "black")
    end

    buttons = joypad.get(1)

    -- Free movement with X.
    if buttons.X then
        
        if buttons.left then
            x = memory.readword(X_ADDR) - MOVE_AMOUNT
            memory.writeword(X_ADDR, x)
        elseif buttons.right then
            x = memory.readword(X_ADDR) + MOVE_AMOUNT
            memory.writeword(X_ADDR, x)
        end
        if buttons.up then
            y = memory.readword(Y_ADDR) - MOVE_AMOUNT
            memory.writeword(Y_ADDR, y)
        elseif buttons.down then
            y = memory.readword(Y_ADDR) + MOVE_AMOUNT
            memory.writeword(Y_ADDR, y)
        end

        if MOVE_CAM then
            if buttons.left then
                cam_x = memory.readword(CAM_X_ADDR) - MOVE_AMOUNT
                memory.writeword(CAM_X_ADDR, cam_x)
            elseif buttons.right then
                cam_x = memory.readword(CAM_X_ADDR) + MOVE_AMOUNT
                memory.writeword(CAM_X_ADDR, cam_x)
            end
            if buttons.up then
                cam_y = memory.readword(CAM_Y_ADDR) - MOVE_AMOUNT
                memory.writeword(CAM_Y_ADDR, cam_y)
            elseif buttons.down then
                cam_y = memory.readword(CAM_Y_ADDR) + MOVE_AMOUNT
                memory.writeword(CAM_Y_ADDR, cam_y)
            end
        end
    
    end

    -- Toggle screenshot dumping with Y.
    if buttons.Y and not y_pressed then
        take_screenshots = not take_screenshots
        message = string.format("Screenshot dumping: %s", tostring(take_screenshots))
        print(message)
    end
    y_pressed = buttons.Y

    -- Dump screenshots for map-making purposes.
    if take_screenshots then
        frames = gens.framecount()
        if frames > 0 and (frames % 15) == 0 then
            file_name = string.format("Map_screenshots\\%d_%d.gd", rendered_frame_cam_x, rendered_frame_cam_y)
            file = io.open(file_name, 'w')
            io.output(file)
            io.write(gui.gdscreenshot())
            io.close(file)
        end
    end

    -- Update coordinate stuff.
    rendered_frame_x = memory.readword(X_LAST_FRAME_ADDR)
    rendered_frame_y = memory.readword(Y_LAST_FRAME_ADDR)
    rendered_frame_cam_x = memory.readword(CAM_X_LAST_FRAME_ADDR)
    rendered_frame_cam_y = memory.readword(CAM_Y_LAST_FRAME_ADDR)

end)


(Source: Espyo)