doomhack / GBADoom

A port of prBoom to the Nintendo GBA.
181 stars 24 forks source link

Status Bar background removal and render resolution adjustment #37

Open e97kj48 opened 1 year ago

e97kj48 commented 1 year ago

I've been experimenting with this port in my own fork, /GBAminitest, so you can take a look at that to find your good code in a mangled mess.

Sadly I've run into/created a bug that I can't fix for the life of me. I am trying to remove the status bar background and make the game render in the full 240x160. I deleted the code that draws the stbar background, made the widgets refresh every frame, and made the renderer and gun sprite draw in the full resolution.

It was successful in removing the stbar background, keeping the stbar displayed at all times, and drawing everything on the full screen properly except for the floor textures in the lower 32 pixels.

So I did some digging, and found a suspicious table (yslope in tables.c) with a bunch of zeroes where I felt data could be. I deleted those zeros and injected my best guess to what a complete table would be, and got pretty good results in rendering floor textures for the entire screen, only now the lower 16 pixels seem to be drawing properly, but offset in some way, like a table has overflowed or something.

Any ideas?

PS: I know there must be much more elegant ways of accomplishing this, so any information or perspectives are invaluable to me.

Here are my working notes, following these instructions from where this distro (doomhack/GBADoom) is now (3 Jan 23) should recreate what I'm describing.

Removed 515-517 from st_stuff.c -stbar bg removed, TITLEPIC showing underneath Rmvd ST_SCALED_HEIGHT from 260, 261, 263 of r_hotpath.iwram.c -renderer draws on the full screen but floor textures are a solid color for 16px stripe -gun sprite still cuts off -stbar only refreshes when face does -treadmill effect on the floor Removed ST_SCALED_HEIGHT from 279 from r_hotpath.iwram.c -no change Removed ST_SCALED_HEIGHT from line 72 of am_map.c -no change Changed false to true in 428 of st_stuff.c -Keeps the stbar widgets refreshing -Disables the text at the beginning though tables.c: deleted 32 zeroes at the end of yslope, duplicated every 4th value -top 128px seem fine, floor scrolls fine, bottom 16px are still weird Changed 128 to 160 in 101 of r_draw.c Removed ST_SCALED_HEIGHT from line 311 of st.lib.c -Draws the gun as expected, bottom 16px still weird Removed +16 from line 279 in r_hotpath.iwram.c -No change Deleted lines 393-427 from st_stuff.c -status bar still updates normally

You can see all of this in my latest commits.

e97kj48 commented 1 year ago

I'm sure there's a better way to document and share what I've been up to, but I have only been handling code for about a week now and I'm trying to learn everything as I go.

Oh and I realize this is absolutely not the intended use for this project, but if I can get this to accept custom HUDs that would be cool. Maybe a Hexen port?

fusermarucs commented 1 year ago

Hiya - I can't help with any coding but just wanted to say that it is great you are working on this! Would be quite cool to see a full screen version of Doom working on the gba, though I bet the framerate takes a hit doesn't it??


From: e97kj48 @.> Sent: Tuesday, January 3, 2023 11:29:31 AM To: doomhack/GBADoom @.> Cc: Subscribed @.***> Subject: Re: [doomhack/GBADoom] Status Bar background removal and render resolution adjustment (Issue #37)

Reopened #37https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdoomhack%2FGBADoom%2Fissues%2F37&data=05%7C01%7C%7C58290a1fd10b49f27fe608daed7dc916%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638083421736652745%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hQ%2B1vShbE54g81T7MNY5JQ0UHW6F3g7F1ISf0lZTGBs%3D&reserved=0.

— Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdoomhack%2FGBADoom%2Fissues%2F37%23event-8142098142&data=05%7C01%7C%7C58290a1fd10b49f27fe608daed7dc916%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638083421736652745%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BYMU5wmraFdjY6EiECUfvlfvE3sNd4IaRQJgToQ03wo%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAXXHH4XQ5I32PI2D63TARSDWQQERXANCNFSM6AAAAAATPS2ECQ&data=05%7C01%7C%7C58290a1fd10b49f27fe608daed7dc916%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638083421736652745%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=peyJWZK%2BKs5wQuWg81prdcrbjnkLGD98HGoY%2BA3y1T8%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>

e97kj48 commented 1 year ago

I appreciate the enthusiasm, and I am expecting the framerate to drop, but I won't know by how much until I get it running properly. I haven't done any testing on retail hardware yet, but plan to soon.