IGNORED

# the official Channel F thread!

## Recommended Posts

"Competition":

What's the fastest collision code between two rectangles? Let's say we have one 4x5 and one 6x7 block (width first), the coordinates are set in the upper left corner, I think that's standard?

So small block is at (x1, y1) and the other (x2, y2).

Used area for small block is from x1 to x1+4 and y1 to y1+5, larger block covers x2 to x2+6 times y2 to y2+7.

Let's say the collision check should be done for the entire block, not just the frame of the object (which would be enough if only one block is moving one pixel at the time). If they overlap it's a collision.

Write as a subroutine, returning data in accumulator (A), any data for collision and 0 for no collision. Data is in octal register 30 in this order: x1, y1, width 1, height 1, x2, y2, width 2, height 2. (filling register 'O'30 to 'O'37).

It's just an example case, I bet there's some clever things that can be done. I'll check what I usually do and come back with my spaghetti code. I think a lot of cycles could be saved as it's something that needs to be done at every graphic update.

##### Share on other sites

I need to definitely improve my collision code in assembly, I really struggle with it every time. Billiards isn't doing too bad, but it's not how I would normally do it. I got a lot of other projects reliant on getting it sorted.

##### Share on other sites

My #24 came today. I now have a complete collection (minus Checkers, of course.) I think it works. It works kind of oddly, with each person picking a pattern and then the game plays out. Is that how it's supposed to work?

##### Share on other sites

I think it's correct... have never played it, neither have I played Baseball - only listened to the tune.

Instructions here (among other sources), there's also a scanned version in the Facebook-group.
https://channelf.se/gallery/txt/videocart24.txt

##### Share on other sites

I don't have permission to view that page. And a 403 error too apparently.

##### Share on other sites

That's odd, I have perhaps set something up wrong, it opens fine from the list.

If you click R at VC 24 on this page it should display properly.
https://channelf.se/gallery/index.html

Quick solution:

Spoiler

```
P R O   F O O T B A L L
VIDEOCART
24

Z

Have you studied the eight offensive plays and the eight
defensive plays? Are you ready to go out on the gridiron
four grueling quarters?

Get Set

Insert the Videocart(TM) Cartridge into your unit with the
edge label toward you and the top label facing up.
Press the reset button. The football field will appear
on screen going from left to right.

The field is 100 yards long and is divided into 10 yard
increments. The "X" team is on the left and is controlled
by the left hand controller. The "O" team is on the right
and is controlled by the right hand controller.

The Notre Dame Fight song will play. Then the time
will indicate that thereare four minutes (approximately)
to go in the quarter and the score is 00 to 00.

The teams are now huddled on the field. The first

GO

The team with the ball (the player with the ball is red)
has 30 seconds to select plays one through eight (8) positions
and twisting the hand controller. The defense then has
about 2 seconds to enter defensive play 1 through 8 if
he has not already done so. Play is started by the
offense by making a motion on the hand controller.
The game has begun. You can now maneuver your
players by moving the hand controllers in the direction
you want them to go.

The Game

Two players compete in a football game with six men
per team. There are 8 offensive plays and 8 defensive
plays with the game contestants able to control their
feature running, passing, sweeps, field goals, and
punting. Defensive plays feature linebacker blitzing
and pass defense.

###################################
###      1            3:00      ###
##   .-+-+-+-+-+-+-+-+-+-+-+-.   ##
##   | |            X O    | |   ##
##   | |      X            | |   ##
##   | |  X  O             | |   ##
##   | |     XO      O  O  | |   ##
##   | |   O      -*  X    | |   ##
##   | |      X            | |   ##
##   | |                   | |   ##
##   *-+-+-+-+-+-+-+-+-+-+-+-*   ##
###                             ###
###################################

The game starts with the playing of the Notre Dame
fight song. When either team scores, the Wisconsin
victory song is played. The score is displayed each
time a team scores. Blue score is for the blue team and
green score is for the green team.

Each team has four downs to try to move down the
entire field and score. If the offensive team does not
score within the four downs, the ball is turned over to
the other team who then has four downs to attempt
to score. The down is shown at the top of the screen
and is blue or green, depending on who has the ball.
The remaining time for the quarter is continuously
shown and only runs when the ball is in play.

The offensive plays are as follows:

Play 0  X---+         Offensive
|_
X
X X                                        /\
X---------------.       Play 1  X---------´  \
|                             \
X-----------. V .-->       X  X              `
\ /           X--|              ,
V                             /
X---------.  /
Play 2  X-------------.   ,                      \/
|  /
X             | /
X  X             |/
X---|         /| ´       Play 3  X-.
X---------´ |                  /--------->
<-´                 X
X  X
X------------>
Sweep left green               X----------,
Play 4  X-._                                   ´----->
_ ¨->
X´_    _.´                    Sweep right , blue
X  X´  _.´                Play 5   X---.  ,´
X--._.´                                 `´
X----------->                   X
Sweep right blue               X  X-../______    ,
X----------->   ,´
X---------..´
Play 6  X------------._____            Sweep left green
_
|X              _.´
X |X           _.´
X/ X----.   .-´
`-´
Play 7     Field Goal
Nobody moves until ball is kicked
Play 8     Punt

Selecting Plays

When the players are in the huddle, both offensive
and defensive teams select plays by moving the hand
controller to the desired direction and then twisting.

1

8        .-.        2
//_\\
/     \
/       \
/         \
7       /     0     \       3
/             \
|               |
`--------------´

6                   4

5

The offense has 30 seconds to enter a play. The
defense then has about 2 more seconds to enter a play
if he has not already done so. As the offense comes
to the line, if either team was late in selecting, play 0
is chosen for them.

After selecting a play, the offense starts the ball in
motion by making any movement on the hand con-
troller. If a punt or field goal is being executed, the first
movement is to move the hand controller in such a way
as to move the ball away from the line of scrimmage. If
the offense fails to begin within 5 seconds, it is assessed
a penalty of 10 yards, but has the same down number.

Offensive Plays

Passing: To throw a pass straight ahead, push down on
the hand controller. To throw a pass at an angle to the
QB's left, twist the handcontroller counter clock-
wise then push down. To throw to the QB's right,
twist clockwise and then push down. Passing can be
successfully completed over the heads of defensive
players as long as there is a pass reciever in line with
the pass and the defensive backman is not twice as
close to the reciever as to the quarterback. Defensive
and offensive linemen can not catch the pass. The
intended reciever is one closest to the flight path
of the ball.

The quarterback cannot pass the ball after going past
the line of scrimmage.

As the play starts, the recievers run a pattern according
to the selected play. As soon as the ball is in the air,
all recievers are moved via the hand controller.

If the quarterback is in trouble and passes the ball out
of bounds, he is assessed a penalty for grounding and
loses the down.

Field Goal: Select play 7. To execute play, move ball
back from scrimmage and push down hand controller.
A kicked ball wobbles back and forth. A field goal
can only be completed from about 30 "yards" from
the goal line. The ball will either go straight and score,
or it will go off to the right as a missed attempt and not
score, as it happens occasionally in real football.

Punt: Select play 8. Execute same as field goal.

Defensive Plays
Some plays allow defenders to have one backfield man
(defensive man stays closer to the center of the field).

If the defender wants control of this player, he twists the
hand controller. Control stays with the hand controller
for the rest of the play.

The defense can catch any ball behind the intended
reciever. He can also intercept if he is twice as close to
the intended reciever as he is to the quarterback.

The defensive linemen will break trough and go after
the quarterback if he dawdles behind the line too long.

The linebacker is normally goes straight for the ball
(like the line man). However, on some plays he "blitzes"
to the side and then has a straight shot at the quarter-
back.

Play 0 - All three backmen under computer control
Play 1 - Player 2 follows inside
Play 2 - Player 2 follows behind
Play 3 - Player 1 follows inside
Play 4 - Player 1 follows behind
Play 5 - Line backer blitzes, player 2 follows inside
Play 6 - Line backer blitzes, player 2 follows behind
Play 7 - Line backer blitzes, player 1 follows inside
Play 8 - Line backer blitzes, player 1 follows behind

Scoring
Touchdown:   7
Safety:      2
Field Goal:  3

Have Fun

Other exciting Videocart cartridges are available from

ZIRCON INTERNATIONAL INC.
475 Vandell Way
Campbell, California 95008

Exclusively for use with
the Fairchild Video Entertainment Systems
Channel F and Channel F System II.

*VIDEOCART is a trademark of Fairchild Camera and Instrument Corporation

Printed in U.S.A.```

Edited by e5frog
##### Share on other sites

As my brother said when he saw me mocking this up, I don't know anything about programming.

But I was thinking, there's no Platform games on the Channel F

Would something like this even be possible?

(Added the text because when I've done mock-ups before people asked how I programmed it)

Edited by siccoyote
##### Share on other sites

If limiting moving graphics I see no reason why it couldn't work.

... there's not much of anything on the Channel F.

Edited by e5frog
##### Share on other sites

15 hours ago, siccoyote said:

As my brother said when he saw me mocking this up, I don't know anything about programming.

But I was thinking, there's no Platform games on the Channel F

Would something like this even be possible?

(Added the text because when I've done mock-ups before people asked how I programmed it)

I'm working on a platformer, but more basic than your mockup. I came across some issues, it's mostly my understanding of how to handle assembly, I got ideas going forward but I easily stop and move onto something else.

##### Share on other sites

Having a go at programming by editing other programs, But seems what I churn out isn't working.

At the moment I am just trying to output to the screen 4 graphics which each are 7 tiles high and 3 tiles wide, based on 32 custom entered tiles. Looking at the source codes I'm not sure what I need to do this and what is un-needed.

I've made my graphics in a paint program and converted them to 8x8 binary, but not sure what the minimum code would be to display them on the screen.

##### Share on other sites

26 minutes ago, siccoyote said:

Having a go at programming by editing other programs, But seems what I churn out isn't working.

At the moment I am just trying to output to the screen 4 graphics which each are 7 tiles high and 3 tiles wide, based on 32 custom entered tiles. Looking at the source codes I'm not sure what I need to do this and what is un-needed.

I've made my graphics in a paint program and converted them to 8x8 binary, but not sure what the minimum code would be to display them on the screen.

I've got the code to some of my games on Github. Here's one:

https://github.com/1888games/TentsAndTrees_CF

If you look in scripts/chars.asm, you can see where I've set up tile data. First a table of pointers to each tile's data, then the tiles themselves.

Then in scripts/draw.asm there is a function DrawTile, that hardcodes the width and height to 5 before calling blit. These values could always be read in dynamically instead.

All the game code in this project is in main.asm (naughty programmer, all my subsequent games were much more modular...)

In there you can see whenever I do 'pi DrawTile' I first load:

BackgroundColour into R1
ForegroundColour into R2

X into R3

Y into R4

TileID into R5 (the position of the tile data in the list of words called 'tiles')

Once you can display one 'tile' or 'char' on the screen you can move onto displaying a series of them. Channel F is a very tricky system to cut your teeth on, the CPU is very quirky and drawing stuff to the screen is very slow. Even if you've done assembly on other simpler chips like the 6502 or Z80 it can still get confusing.

Edited by Arlasoft
##### Share on other sites

14 minutes ago, Arlasoft said:

Once you can display one 'tile' or 'char' on the screen you can move onto displaying a series of them. Channel F is a very tricky system to cut your teeth on, the CPU is very quirky and drawing stuff to the screen is very slow. Even if you've done assembly on other simpler chips like the 6502 or Z80 it can still get confusing.

Thanks for the help,

As far as coding experience I've done Pascal about 22 years ago

I can't even tell what is and what isn't code.

The idea I have in mind doesn't require quick drawing to the screen.

##### Share on other sites

Here's code to plot one pixel:

```;---------------;
; Plot Function ;
;---------------;
; plot out a single point on the screen
; uses three registers as "arguments"
; r1 = set color
; r2 = x coordinate (4-105)
; r3 = y coordinate (4-61)
;------------------------
; Valid colors
;------------------------
; green	= \$00 (%00000000)
; red	= \$40 (%01000000)
; blue	= \$80 (%10000000)
; bkg	= \$C0 (%11000000)
;------------------------
plot:
; set the color using r1
lr	A, 1
outs	1
; set the column using r2
lr	A, 2
com
outs	4
; set the row using r3
lr	A, 3
com
outs	5
; transfer data to the screen memory
li	\$60
outs	0
li	\$50
outs	0
; delay until it's fully updated
lis	6					; Value here is 4 in Videocart 21, Bowling
.plotDelay:
ai	\$ff
bnz	.plotDelay
pop							; return from the subroutine```

You'll also find routines for "blit" object and multiblit for encoding multiple colors in one set of data, where boxes with pixels can be defined as data and drawn all at once.

Before drawing, use the screen clearing subroutine in the machine ROM ( ; means comments):

; Set Accumulator to color value

LI  \$D6  ; grey, green \$C0, blue \$93,  b/w \$21

; Load register 3 with value from Accumulator

LR  3, A

; Subroutine call to built-in screen clear

PI  \$00D0

; Routine clears with color set in r3

; You'll end up here after return.

LI  \$40      ;  \$40 in accumulator

LR  1, A     ; Load register 1 with what's in A

LI 30   ; Coordinate as decimal number

LR  2, A

LI 30

LR  3, A

PI  plot  ; Call the above plot routine

plot:

;paste plot routine here

Should result in a red dot on screen.

There's a "drawchar" routine in system ROM as well, you set data address with DCI "address for graphics"

Then "PI \$067C" to call it. The size will of course be limited to ROM character size, better to have your own. I think you set coordinates and data offset in the lower registers... have never used it myself.

You always need to start with \$55 and a second value, program starts at \$0802.

See what you can find on my wiki, there's a nice op-code table, very useful help when there's a need to check what options there are to reach a certain goal.

##### Share on other sites

Have a go with my one pixel movement too found here:

One pixel.ASM I haven't checked it but pretty sure that one is working!

##### Share on other sites

On 6/25/2022 at 3:21 AM, 3DMAZE said:

Firstly, I got Mad Genius.bin fixed! I implemented the XDC instruction, and fixed an address bug. Sounds a little better I think

i hope u didnt get mad from listening to this track over and over. lol

##### Share on other sites

On 8/1/2022 at 7:12 PM, kleeder said:

i hope u didnt get mad from listening to this track over and over. lol

##### Share on other sites

On 8/3/2022 at 11:22 AM, e5frog said:

i mostly play it on piano these days instead of listening to the channelf version tho

##### Share on other sites

Can I make a game with any size? Like, for example, say I wanted for some bizarre reason I wanted to make a 27k game. Could I?

##### Share on other sites

9 hours ago, atari2600land said:

Can I make a game with any size? Like, for example, say I wanted for some bizarre reason I wanted to make a 27k game. Could I?

I would be interested in this as well. I think dasm doesn't like odd numbers other than 1kb but I've never had to try more than 8kb yet.

##### Share on other sites

Not sure about DASM, IIRC MESSUI now-a-days allow odd sizes.

Try, if there's a problem just write a byte at an "even" end address and cut it in a hex editor.

Don't know why though.

For a real system it doesn't matter, you might find it difficult to make a 27k memory layout.

Just write 0 at org \$ffff, do your work and then resize if needed.

##### Share on other sites

Custom size in DASM seems fine, tried 1985 bytes, no problem.

Starts fine in MESSUI 0.245.

##### Share on other sites

Yeah tried it myself as well, no issues with odd sized bytes, but wondering if we should keep to even numbers for any romcart solutions using the suggested model?

I had another look at Shark again to fix some of the issues.

First off, I've improved the graphics refresh to stop the flashing for the character and the shark. The fish was coded in a slightly different way, so I need to rewrite it still to make it similar, so that still flashes. Movement as a result is now faster.

Secondly, I've made some efforts to fix the highscore keeping. I didn't realise but this wasn't working right, I was trying to code it by subtracting the highscore and the new score - in theory a positive number would lead to a replacement, a negative number would skip and a zero would check the next digit. I found that this worked fine for a higher number, but not when a number was smaller and it would wipe the highscore back to zero. This time I invert the highscore number, then add the new score to it, if it overflows and sets the carry flag, it will replace the number, if it is equal to 255 then it checks the next digit, anything else it skips the check. This seems to have worked perfectly, so its now good enough to re-release.

Edit: Oh totally forgot to mention there is a couple of new beeps: one for collecting fish, and a "aiieee" sound for being bitten by the shark.

There was some changes I think to the fish movement but its still pretty much the same, so there is still a bit more work to do on that to randomise it a little better, but I will do that when I change the graphic display for it so it doesn't blink.

So not much actual change, but rather a look back at what I've done in the last 12 months and making some general improvements. Tested with Mess0210b (I really should update sometime...).

Edited by Mikebloke
##### Share on other sites

Question has been raised - how can a recently made homebrew game be played on original hardware?  Been looking for anything to load ROMs from an SD card (like the recently made Centipede) but no luck thus far...

##### Share on other sites

32 minutes ago, Crimefighter said:

Question has been raised - how can a recently made homebrew game be played on original hardware?  Been looking for anything to load ROMs from an SD card (like the recently made Centipede) but no luck thus far...

There is someone here working on a solution.

##### Share on other sites

1 hour ago, Crimefighter said:

Question has been raised - how can a recently made homebrew game be played on original hardware?  Been looking for anything to load ROMs from an SD card (like the recently made Centipede) but no luck thus far...

@3DMAZE was working on a solution check a little back in the thread, there is a working prototype, but hasn't updated us in awhile. That would likely be the closest to a regular consumer product so far. E5frog has examples of the next best thing from a technical perspective, flashable roms / multicarts, though only multicarts have traditionally been on sale. Also note that Centipede is on offer with the Arlasoft collection found here:

## 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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.