Jump to content
IGNORED

titlescreen kernel


RevEng

Recommended Posts

Thanks, Philsan!

 

The titlescreen ternel is pretty much ready for an alpha release folks, so here it is...

 

titlescreen_kernel_alpha_20100726.zip

 

 

...along with the obligatory screenshot and bin file...

 

post-23476-128019677424_thumb.png

titledemo.bas.bin

 

 

Be sure to checkout the README and the demo basic program before you try to add a titlescreen to your own game.

 

The demo has a 6 minikernels in it, each one with page alignments for critical code, so it's a bit bloated. If you're looking to use just a portion of a bank, try using fewer minikernels with larger graphics.

 

I've purposefully left out instructions on how to prepare the graphics files, mostly because I'm not sure what the best process is. I know there was a tool that was used for Michael's bitmap kernel... not sure if that will work well here or not.

 

Any suggestions on that, or anything else, would be appreciated!

  • Like 3
Link to comment
Share on other sites

Very cool. Played around with the tool I wrote to generate bb Code for Michael's bitmap kernel and after about 5 min I was able to generate your byte code.

 

Just choose playfield and title settings and make sure to resize the image for the appropriate width and height. Then replace in the various .asm files to create your own.

 

ImgtoCode.0.9.1.4.zip

 

Here an example of converting the AtariAge logo.

post-5778-128030100432_thumb.jpg

AAtitledemo.bin

 

-Jeff

  • Like 2
Link to comment
Share on other sites

I made something, but my attempted drawing sucks. I think jwierer should post his tool, or something that would generate code for images. Of course, I don't know how, but it'd be nice to have something that converts bmp images that are either 48 or 96 bytes high or long or whatever. That way you can draw whatever you want and not worry about how it'd look. Anyway, RevEng should be applauded for his accomplishment, it just is a little too hard for me to get any drawing right.

 

EDIT: Saw that he did post his tool. :dunce: I shall try to comprehend how it works.

Link to comment
Share on other sites

I tried to compile an image, and it said the asm RevEng made up was 136 bytes too big for a bank! How could I do something with one image and make it work and have another not work by using the exact same code? Attached is the image I tried to compile with my code.

48x2_1_image.txt

Link to comment
Share on other sites

There's a height restriction on the minikernels - I thought I had put a comment for this in the asm files themselves, but it looks like I missed it. I'll add this to the docs for next time.

 

Basically the code maxes out at 256 bytes. So for a 48-wide, that means 42 lines. I trimmed a few lines from your image and it compiled, though it made the screen larger than 262 lines. To fix that you'd need to rework the layout, possibly removing blank space and/or the minikernels displayed.

 

I was planning to look at working around the 256 byte restriction in some of the minikernels, though the 48 wide 2 line wasn't high on the list, since it can take up half the screen at its maximum height.

 

@jwierer: Thanks for the tool update - that makes it much easier! :thumbsup:

Edited by RevEng
Link to comment
Share on other sites

I was just wondering. It would be cool in my game I might make (NBA Basketball 2011) to select the team by having the team logo appear instead of the NBA logo. Since it'd probably have to be divisible by 2, the number of logos could be 32 (30 NBA teams + NBA logo + my team I'll make). Was just wondering if there was a way you could fit more than one title screen logo and change it by for example, joystick left and right.

post-9475-128031308289_thumb.png

Link to comment
Share on other sites

Couldn't SeaGtGruffs technique of gosub'ing inline assembly work?

 

@jwierer: Thanks for sharing the awesome ImgtoCode tool! The redraw in VisualbB really sucks on my workstation. I think I'll try using a paint program for sprite and playfields with this!

Edited by theloon
Link to comment
Share on other sites

Couldn't SeaGtGruffs technique of gosub'ing inline assembly work?

That's pretty much what's already done to call my kernel, only I've hidden the assembly away in external files.

 

The issue presently is the 48 wide minikernel is hardcoded to the rom location of the image. I made the decision to do that for 2 reasons - it uses less cycles that way, and I figured it was easier UI for you guys to have a 1:1 mapping of the kernel to the data.

 

The downside is, to have additional images with the present code you'd need to have additional near-identical minikernels. 32 routines and padded just isn't going to fit.

 

Instead I'm thinking about a minikernel that has a predefined height, and more data lines than that height. Then you tell the minikernel which line to start the display with by setting a variable or two. This would allow you to scroll smoothly or skip images, whichever you please.

Edited by RevEng
Link to comment
Share on other sites

I'm a bit confused.. I opened an image in the img2code program. It outputted all %11111111.

 

I'm trying to see if I can get an Activision logo, but make it say "Activishawn", my name. icon_smile.gif

 

As you should icon_smile.gif My modification only outputs the .byte codes that you can use in the titlescreen kernel. Here are the basic steps:

 

1. You'll need to copy over the titescreen kernel to your program.

2. Within that folder, you'll see a series of ASM files that contain the different elements which vary in dimension 48x36 96x7 etc...

3. Take the image (bmp, jpg, gif, etc..) and load it into imgToCode.

4. Replace the .byte codes in the appropriate assembly files.

 

For example if you wanted to use the AtariAge logo I used you would use the following and then copy it into 48x2_1_image.asm

 

post-5778-128034564663_thumb.jpg

 

It's possible to create a fully automated tool, but this should work for now.

 

-Jeff

Link to comment
Share on other sites

This might have been my partial stupidity. I was at work, dying to test it out, and was doing it while my bosslady wasn't looking. I think I didn't crop out anything, so yes there probably should have been a lot of %11111111.. all the dead space around the logo.

 

Going to give it another go now.

 

I'm a bit confused.. I opened an image in the img2code program. It outputted all %11111111.

 

I'm trying to see if I can get an Activision logo, but make it say "Activishawn", my name. icon_smile.gif

 

As you should icon_smile.gif My modification only outputs the .byte codes that you can use in the titlescreen kernel. Here are the basic steps:

 

1. You'll need to copy over the titescreen kernel to your program.

2. Within that folder, you'll see a series of ASM files that contain the different elements which vary in dimension 48x36 96x7 etc...

3. Take the image (bmp, jpg, gif, etc..) and load it into imgToCode.

4. Replace the .byte codes in the appropriate assembly files.

 

For example if you wanted to use the AtariAge logo I used you would use the following and then copy it into 48x2_1_image.asm

 

post-5778-128034564663_thumb.jpg

 

It's possible to create a fully automated tool, but this should work for now.

 

-Jeff

Link to comment
Share on other sites

Nah.. I don't really understand.

 

I think we need a better tutorial from start to finish.

 

1 - Do I need to resize the image I am using first?

 

2 - Do I need to specify an image size in img2code program? If I click the titlescreen button and click create image, it automatically does 96 x 48 for me.

 

So far all I get is garbage.. I am looking at a bunch of 1's and 0's in img2code program and it doesn't look like it'll make anything useful.

 

I get this:

 

DASM V2.20.07, Macro Assembler ©1988-2003

bytes of ROM space left in bank 1

bytes of ROM space left in bank 2

bytes of ROM space left in bank 3

bytes of ROM space left in bank 4

3965 bytes of ROM space left in bank 1

-136 bytes of ROM space left in bank 2

segment: 2fd4 eqm vs current org: 305c

titledemo.bas.asm (204): error: Origin Reverse-indexed.

Aborting assembly

Errors were encountered during assembly.

 

I did manage to get one bin outputted to test, but get a black screen.

Edited by yuppicide
Link to comment
Share on other sites

The reverse-origin thing is due to there being more than 256 image bytes. If you reduce the number of lines you should get it to assemble correctly.

 

For a 48-wide bitmap (6 bytes wide) you can use 42 (or less) lines. (256/6=42.6)

 

For a 96-wide bitmap (12 bytes wide) you can use 21 (or less) lines. (256/12=21.3)

Link to comment
Share on other sites

Nah.. I don't really understand.

 

I think we need a better tutorial from start to finish.

 

1 - Do I need to resize the image I am using first?

 

2 - Do I need to specify an image size in img2code program? If I click the titlescreen button and click create image, it automatically does 96 x 48 for me.

 

So far all I get is garbage.. I am looking at a bunch of 1's and 0's in img2code program and it doesn't look like it'll make anything useful.

I had to look at the assembly to understand it myself. Take the example RevEng posted. The central image is 48x36, so yes you will need to make sure you set the width and height so it only outputs an image 48 pixels across and 36 pixels tall. Any larger and it's not going to work. Replace .byte values in the sample .ASM and try to compile. Once you get that working you can mess with everything else. Keep in mind the differents regions are going to be different dimensions, 98x8 etc... so for each portion you replace you'll need to set the appropriate width/height before generating the .byte data. My tool is only going to spit out the .byte values, you need to replace each section in the .ASM files seperately. Still it's better than drawing by hand icon_smile.gif

 

-Jeff

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...