Jump to content
IGNORED

Skill Level Select Screen - Noob alert


coleconut

Recommended Posts

Might answer all my own questions but asking anyway...

I thought it might be fun to translate a CV game into a different language.

Using a hex editor, I easily found all the text strings and translated them, but couldnt find the skill level select screen.

Assuming therefore that this is not a text screen but an image.

So wondering why they did that, assume it takes less bytes than a text screen?

And for someone with minimal programming skills what kind of challenge would I have replacing this screen with a different one.

I have an MSX game with the proper translated screen but dont know where in either program this screen resides and if I did, if they had the same number of bytes.

Link to comment
Share on other sites

It even sets up all of the video registers and uploads the fonts. It is a pretty powerful OS7 entry point. It is called GAME_OPT in my Mayan guide to programming OS7, and is at 1f7ch, so look for:

 CALL 1f7ch

somewhere in the game.

Link to comment
Share on other sites

It even sets up all of the video registers and uploads the fonts. It is a pretty powerful OS7 entry point. It is called GAME_OPT in my Mayan guide to programming OS7, and is at 1f7ch, so look for:

 CALL 1f7ch

somewhere in the game.

So if there's extra ROM space, you could potentially copy the applicable BIOS code into your ROM and modify it as you wish.

Link to comment
Share on other sites

  • 8 years later...

The skill select screens were all programmed game by game. There is no built in routine.

 

just print a similar screen using print_at routine and use keypad input to select the skill and use a variable something like : skill=1; if that keypad 1 is pressed.

 

7 hours ago, Zak said:

hi,  i'm using SDCC + col4k,  how i can make the call to skill select screen from C ? or it configures in cart0.s ?  tnks very much

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, digress said:

The skill select screens were all programmed game by game. There is no built in routine.

Looking at manuals, it appears there is a routine GAME_OPT that will display that standard screen (and leave you in that graphics mode), but it is up to you to implement the code to check for the button press. Would have been nicer if that was also baked into the routine, and it just returned 1-8 for you!

 

  • Like 1
Link to comment
Share on other sites

This is the skill select screen routine I recreated for Challenger.  Both the BIOS and the Skill select were recreated since I didn't know how to call them and I already have a recreated BIOS screen in ICVGM due to Spunky's Supercar!.  However, the font graphic was pulled from the BIOS.
 

void SkillSelect(void){
disable_nmi();//necessory to avoid vram corruption
put_vram(0x0100,(void*)0x15a3,512);//load font to pattern table starting at 0x0100
duplicate_pattern();//if you're using screen_mode_2_text(); this is required for 3 pattern/1 color table graphic mode.
fill_vram(0x2000,0xF0,2048);//make every tile white with transparentry(for background color).
paper(5);// set background/border to blue
print_at(6,0,"TO SELECT GAME OPTION,");
print_at(6,2,"PRESS BUTTON ON KEYPAD.");
print_at(6,5,"1 = SKILL 1/ONE PLAYER");
print_at(6,7,"2 = SKILL 2/ONE PLAYER");
print_at(6,9,"3 = SKILL 3/ONE PLAYER");
print_at(6,11,"4 = SKILL 4/ONE PLAYER");
enable_nmi();//all graphic write finished, turn on NMI so the controllers and sound will work.
a=1;
delay(5);
while(a==1){
delay(1);//keeps loop running at 60 fps.  
if(keypad_1==1){livesstart=livesmax=5;nextoneup=nextadd=5;shieldmax=3;a=0;skill=1;speed=0;}
if(keypad_1==2){livesstart=livesmax=3;nextoneup=nextadd=4;shieldmax=3;a=0;skill=2;speed=0;}
if(keypad_1==3){livesstart=livesmax=5;nextoneup=nextadd=4;shieldmax=1;a=0;skill=3;speed=0;}
if(keypad_1==4){livesstart=livesmax=3;nextoneup=nextadd=3;shieldmax=1;a=0;skill=4;speed=0;}
}

paper(0);
cls();
screen_off();
}

 

  • Thanks 1
Link to comment
Share on other sites

On 5/28/2020 at 10:36 AM, digress said:

The skill select screens were all programmed game by game. There is no built in routine.

 

just print a similar screen using print_at routine and use keypad input to select the skill and use a variable something like : skill=1; if that keypad 1 is pressed.

 

 

but  in asm  exists a call  that shows the skill selection screen.  is:    call 1f7ch   .   I search for same in C.  @Kiwi gave me the solution, tnks anyway

Link to comment
Share on other sites

On 5/28/2020 at 7:35 PM, Kiwi said:

This is the skill select screen routine I recreated for Challenger.  Both the BIOS and the Skill select were recreated since I didn't know how to call them and I already have a recreated BIOS screen in ICVGM due to Spunky's Supercar!.  However, the font graphic was pulled from the BIOS.
 


void SkillSelect(void){
disable_nmi();//necessory to avoid vram corruption
put_vram(0x0100,(void*)0x15a3,512);//load font to pattern table starting at 0x0100
duplicate_pattern();//if you're using screen_mode_2_text(); this is required for 3 pattern/1 color table graphic mode.
fill_vram(0x2000,0xF0,2048);//make every tile white with transparentry(for background color).
paper(5);// set background/border to blue
print_at(6,0,"TO SELECT GAME OPTION,");
print_at(6,2,"PRESS BUTTON ON KEYPAD.");
print_at(6,5,"1 = SKILL 1/ONE PLAYER");
print_at(6,7,"2 = SKILL 2/ONE PLAYER");
print_at(6,9,"3 = SKILL 3/ONE PLAYER");
print_at(6,11,"4 = SKILL 4/ONE PLAYER");
enable_nmi();//all graphic write finished, turn on NMI so the controllers and sound will work.
a=1;
delay(5);
while(a==1){
delay(1);//keeps loop running at 60 fps.  
if(keypad_1==1){livesstart=livesmax=5;nextoneup=nextadd=5;shieldmax=3;a=0;skill=1;speed=0;}
if(keypad_1==2){livesstart=livesmax=3;nextoneup=nextadd=4;shieldmax=3;a=0;skill=2;speed=0;}
if(keypad_1==3){livesstart=livesmax=5;nextoneup=nextadd=4;shieldmax=1;a=0;skill=3;speed=0;}
if(keypad_1==4){livesstart=livesmax=3;nextoneup=nextadd=3;shieldmax=1;a=0;skill=4;speed=0;}
}

paper(0);
cls();
screen_off();
}

 

tnks very much!   It is exactly what I was looking for, I thought it was already in the bios de coleco and it only needed to be called, but I see that it has to be done by hand and here your code will work wonders. Thanks for sharing and allowing learning.

Link to comment
Share on other sites

I managed to invoke it in C out of curiosity and from Hardhat post on what address to call at.  It just draws this screen.  If you use hexeditor or the debugger to see the memory map, you can see the string for the skill select screen in the bios. 

 

This might take a bit of work to do.  I added file in lib4k, drawskillselect.s.  Looked at other source codes in the folder to see if I got it right.
 

; drawskillselect.s

	.module DrawSkillSelect

	; global from this code
	.globl  _DrawSkillSelect
	; _DrawSkillSelect (void)
	
	.area _CODE
_DrawSkillSelect:
	call    #0x1f7c
	ret

I type the above.

Then click the batch file, build.bat.  This replaces cvlib.lib in the lower folder. In coleco.h folder, I just added a line way on the bottom, void DrawSkillSelect();

Replace the coleco.h file in the SDCC include folder.

I tried it out with a freshly made source code and the screen came up. 
 

void main(void){
//screen_mode_2old();
screen_mode_2_text();
//vdp_out(4,0);

screen_on();
DrawSkillSelect();
disable_nmi();
pause();
}

It may complain that a function 'DrawSkillSelect' implicit declaration.  One of my complaint about C, always peculiar about where the functions are located even though it doesn't matter in asm land.  It's basically converting C to asm. 

I'm not sure how much it sets up the Colecovision.  It loads the fonts into VRAM, possible graphic mode 1, and etc. 

If you're doing 1 player game, fill_vram(0x1980,32,384); will clear half of the screen.

Challenger was 29KB when it was completed and I wanted to focus on completing the game back then.  So if I needed more memory, I would have done above.

  • Like 1
Link to comment
Share on other sites

11 hours ago, Kiwi said:

Challenger was 29KB when it was completed and I wanted to focus on completing the game back then.  So if I needed more memory, I would have done above.

Yes, saving some bytes that are better used for your game is a great reason to call the OS routine.

 

Another reason is that if the OS ever got an improved version of that routine, for example, one that didn't require using the keypad, you'd automatically be taking advantage of a much nicer version.

 

Just say'in... ;-)

 

  • Like 1
Link to comment
Share on other sites

10 minutes ago, Zak said:

  i already have skill selection screen, i use your code and works perfect.   i have a problem,  in intro CV screen i have garbage at foot,   where i must define the " PRESENTS / THE GAME "  string ?

in crtcv.s  ? 

From the cv programming pdf on page 101.  To have the game name, it would have to be at address $8024-80XX.
 

8024-80XX GAME_NAME String with two delemiters "/" as "LINE2/LINE1/YEAR"

I'm not 100% sure where to place this code, but I believe, adding .org 0x8024, and then the string may do the trick. 

 

I believe as I'm looking into this... placing the string, in between jp _nmi_asm and ;;CODE STARTS HERE WITH NMI will work without the .org 0x8024. jp _nmi_asm is 3 bytes, so it corresponded with the 8021-8023.
 

	.db	0xc9,0,0		; no RST 28 support
	.db	0xc9,0,0		; no RST 30 support
	.db	0xc9,0,0		; no RST 38 support  (spinner)
	jp	_nmi_asm
<-----------Put string data here
	;; CODE STARTS HERE WITH NMI
        .area _CODE

From the tniasm.txt I have, do write string, it's said,

  2.3.2 String Constants

        A string constant is anything between single or double qoutes
        larger than 4 characters. They're used in commands like DB/DW,
        INCLUDE and FNAME. String constants can not be used in regular
        expressions.

        example:
          DB   "a 'double-qouted' string can contain single qoutes"
          DB   'and a "single-qouted" string can contain double qoutes'

So something like DB "WARS/STAR/1983" may be acceptable directive.

 

  • Like 1
Link to comment
Share on other sites

10 hours ago, Zak said:

i already have skill selection screen, i use your code and works perfect.   i have a problem,  in intro CV screen i have garbage at foot,   where i must define the " PRESENTS / THE GAME "  string ?

If you have not already, download the various programming guides found here:

 

http://adamarchive.org/archive/ColecoVision/Programming/

  • Like 1
Link to comment
Share on other sites

 

11 hours ago, bhall408 said:

If you have not already, download the various programming guides found here:

 

http://adamarchive.org/archive/ColecoVision/Programming/

@Bhaal  tnks for the guides.  I found the solution looking another library,  "LIBCV"

 

; crt0.s for Colecovision cart

    .module crt0
    .globl _main
    .globl _cv_init
    .globl _cv_spint_handler
    .globl _cv_vint
    .globl _cv_start
    .globl ___sdcc_call_hl

    .area _HEADER(ABS)
    .org 0x8000

    .db 0x55, 0xaa            ; Title screen and 12 second delay - swap 0x55 and 0xaa not to skip it.
    .dw 0                                ; Sprite name table for BIOS
    .dw 0                                ; Sprite order table for BIOS.
    .dw 0                                ; Buffer for BIOS.
    .dw 0                                ; Controller map for BIOS.
    .dw _cv_start                        ; where to start execution of program.
    jp    0x0        ; RST 0x08            
    jp    0x0        ; RST 0x10
    jp    0x0        ; RST 0x18
    jp    0x0        ; RST 0x20
    jp    0x0        ; RST 0x28
    jp    0x0        ; RST 0x30
    jp spint    ; RST 0x38 - spinner - maskable interrupt
    jp vint        ; Vertical retrace - NMI
    .ascii " / / NOT"

 

 

i test with  "db", ".db", ".org 8024" etc etc.   .ascii  WORKS OK !

 

in  "crtcv.s"  (lib4k)  add :

(line 74)

.ascii "PRESENTA/DIEGO ACCO/2020"

 

 

IMG_20200601_022732777.thumb.jpg.c3a668a3cfc17663a08c265ccee5ef82.jpg

 

very very TNKS TO ALL !

 

  • Like 1
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...