WIP: Reversi

Talk about programming of homebrew games only.
Post Reply
User avatar
MADrigal
Site Admin
Posts: 1192
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi (was Othello)

Post by MADrigal » Wed Mar 06, 2013 4:32 pm

> By using the assembler syntax with labels and #< you rely on the assembler (DASM)
> to take care of all the translations instead that you do it.

I definately need a full guide to DASM syntax. I couldnt find it on the zip archive, maybe it's on the website. Should check it...


> Also if the address is to a text string somewhere in memory, it is almost
> impossible for you to know at time of coding exactly where in memory it
> will be located when the program is assembled.

I see! In fact I found the "#<" addressing method in the "GAME OVER" plotting routine.

I realize that DASM syntax is really useful for such methods, as for the "gentext" routine.

> Be lazy when the assembler lets you, otherwise you could as well have programmed
> in a machine code monitor without any labels, macros and other bells and whistles. :-)

I'm more familiar in reading pure ASM code than the DASM editor. I really need to read the manual carefully :-)
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi (was Othello)

Post by carlsson » Wed Mar 06, 2013 11:18 pm

Well, to be honest I don't know what the differences are. Perhaps you mean disassembled machine code compared to assembly code?

Normally every label needs to be unique in order to assemble it properly. However one special feature with DASM are its local labels ending on $. It means for every new label/section/function that does not end with a $, you could reuse the same local labels without conflict:

Code: Select all

start:
  ldx #0
loop$:
  inx
  bne loop$

main:
  ldy #0
loop$:
  iny
  cpy #14
  bne loop$
Sometimes though one wants different local labels through the whole program to keep them apart, even if technically the above works. If one would remove the $ signs however, DASM would protest about label mismatch.

You also see the extra org's at the end, used to position vector data at their intended positions within the cartridge. That is something you otherwise would have to pad out with zero bytes and adjust as necessary if the assembler didn't do it for you.
User avatar
MADrigal
Site Admin
Posts: 1192
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi (was Othello)

Post by MADrigal » Thu Mar 07, 2013 5:05 pm

Ooooh I see, now I understand what those label$ stand for :-)

As for the ORG in the middle of the ASM code, I was aware of that. It's definately a clever way to code. :-)
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi (was Othello)

Post by carlsson » Fri Mar 08, 2013 10:54 am

MADrigal wrote:No need to reset again, because when game is over, it goes back into SELECT MODE again. The selected mode is the current one, so if you press a key on keyboard, a new game begins on the current game mode.

About music: standard creativision games play a "game start" tune when a game starts (both demo and real). Plus the GAME OVER tune plays when game ends (both demo and real).
After playing a few original games and spending quite some time thinking about it, I'm actually considering purposedly breaking the "standard" behavior. It was set more than 30 years ago and as noted not always entirely user friendly and intuitive. Rather I'll most probably make my Reversi game behave in this way:

1. Power on: Demo mode, no score display. Background music that repeats over and over. Wait for reset button OR fire button.

2. Game select: Redraw board, silence. Use fire button to select mode, start game by pressing a key OR move the joystick.

3. Game start: Short chime or very short jingle to indicate the game begins. I need to add code to read the second joystick for two player games.

4. Game over: Display message, play a short jingle. Wait for fire button. The old board scrolls away (!) or at least is cleared. Now go back to 1 (not 2 as traditional games might have done) to get the demo mode and background music again. It means pressing the fire button twice to get back to game selection. Alternatively I might merge game over jingle with the longer music so it skips the demo mode and goes to game select after pressing the button.

Of course pressing the reset button at any time will always end up in game select.

As you see, small differences to the known behavior but I like it better. It would also give me more freedom for coming games to decide how they should behave individually, e.g. if one has a title screen instead of a demo mode (can sometimes be hard and unneccesary work to program) and in the case of no different game modes to select, immediately start game after pressing fire or reset button.
User avatar
MADrigal
Site Admin
Posts: 1192
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi (was Othello)

Post by MADrigal » Fri Mar 08, 2013 5:45 pm

> After playing a few original games and spending quite some time thinking about it,
> I'm actually considering purposedly breaking the "standard" behavior. It was set more than
> 30 years ago and as noted not always entirely user friendly and intuitive.

Why not? :-)

> 1. Power on: Demo mode, no score display. Background music that repeats over and over.
> Wait for reset button OR fire button.

OK so you're adding the "fire button" check to enter the select mode, is it? Sounds good.


> 2. Game select: Redraw board, silence. Use fire button to select mode, start game by
> pressing a key OR move the joystick.

You should consider that *any* fire button on *any* joystick should "change mode". So it's 4 inputs total.

As for the "game start", I like the idea of allowing player to start when moving any joystick. In my opinion, both joystick should work, either if you're starting a 1-player or 2-player game.


> 3. Game start: Short chime or very short jingle to indicate the game begins. I need to
> add code to read the second joystick for two player games.

OK.

I just noticed that the most recent CreatiVision videogame, Stone Age, is the only title featuring bg-music. So I suppose that if you decide to add a bg-music to Othello, instead of ingame sound effects, would still be a "classic" choice. :-)

Actually there's another game wich a sort of bg-music, that's Auto Chase. There's a jingle playing all along, but the jingle changes every time your car changes direction. I had an idea about this, even though I'm unsure of how the final result would be on Othello...
Idea: why not adding TWO bgmusic to the game, one playing when its player1 turn, and the other playing when it's player2 turn?


> 4. Game over: Display message, play a short jingle. Wait for fire button.

Question. Why fire button again to enter select mode? Why not making the "game over" = "select mode" and let a new game start with joystick move without having to enter a select mode again?

Aha I see, you're willing to add replay the demo mode after a game, that's the real "new addition" to your game. In fact the "classic" games never show the demo mode again, unless you turn the console off.

I like the idea, makes the game more "modern". :-)


> The old board scrolls away (!) or at least is cleared. Now go back to 1 (not 2 as traditional
> games might have done) to get the demo mode and background music again. It means
> pressing the fire button twice to get back to game selection.

I see. :-)


> Alternatively I might merge game over jingle with the longer music so it skips the demo
> mode and goes to game select after pressing the button.

Well that's more or less what the original games do.

I think there should not be a bgmusic after "game over" jingle.


> As you see, small differences to the known behavior but I like it better. It would also give
> me more freedom for coming games to decide how they should behave individually, e.g.
> if one has a title screen instead of a demo mode (can sometimes be hard and unneccesary
> work to program) and in the case of no different game modes to select, immediately start
> game after pressing fire or reset button.

I like your ideas.

On a side note, I noticed that the console displays (C) 1981 when your game starts. The 1981 date appears on 90% of the Creativision games, except the most recent ones, which display 1983.

Have you investigated how the date is set in the BIOS, or is there a way to change the 1981 to 2013? I always thought "198" was preset, and earlier games set a "1" in the "game boot" routine, while some others set "3".
User avatar
MADrigal
Site Admin
Posts: 1192
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi (was Othello)

Post by MADrigal » Sun Mar 17, 2013 8:33 am

Hi man, have you stopped developing the game? Any good news?
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi (was Othello)

Post by carlsson » Mon Mar 18, 2013 3:51 pm

No, I'm just being lazy and a bit low-key at the moment. Those last bits of polish are always the dullest to do. I'll have a go at finishing it Real Soon Now, and then start looking into the next game.

How are you doing, any own code yet?
User avatar
MADrigal
Site Admin
Posts: 1192
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi (was Othello)

Post by MADrigal » Mon Mar 18, 2013 5:26 pm

Well no code yet, I'm into writing and translating the tutorial about the composite video output mod.

I've been contacted by a friend programmer, who's willing to also code games for the CV. He's looking for "Appendix E" of the "Programming guide" to the TMS9918.

There's a guy who owns the book, (it's a sort of in-deep datasheet) and he scanned it all except Appendixes E and F, which contain many (interesting?) bits of ASM code to programme the TMS9918 in 6502.

Have you got that book?
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi (was Othello)

Post by carlsson » Mon Mar 18, 2013 9:27 pm

Well, isn't that the same document as linked to before, with the programming examples omitted?

Frankly, if your friend is anywhere skilled in 6502 programming, Kurt's examples + my code above should be plenty to get going without the need for additional code examples.
User avatar
Mobsie
Posts: 709
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: WIP: Reversi (was Othello)

Post by Mobsie » Tue Mar 19, 2013 10:20 am

Hi Carlsson,

first Sorry for my bad english, i am from germany.
I read a lot from you on the VIC-20 forum, i can from the VIC-20

The Vic-20 was my first computer after i cannot buy a CreatiVision.
I search the Ti ASM samples, is only interesting for me how they show todo some stuff on different CPU.
These are 26 Pages ONLY with ASM source.

But programming the CreatiVision is possible without, i play now with different screen mode and try to convert my "SoftSprites" code.
Is a dream combination the TMS9928 and the 6502 because i hate the Z80.

Mobsie
Post Reply