Page 3 of 5

Re: Memory maps, chip documentation

Posted: Tue Feb 05, 2013 10:12 am
by MADrigal
Afaik, the memory expansion module for CV was never actually released. From my info, it could provide 14K in the higher RAM area, excluding the BIOS. I agree that if used in combination with the I/O module, the RAM would decrease to 10-12K as Barry suggested.

Main problem with the RAM expansion is that it would have been totally useless because the BASIC had no commands/routines to store data there, and you could just peek & poke into that RAM area.

Re: Memory maps, chip documentation

Posted: Sat Feb 09, 2013 1:18 am
by carlsson
Regarding how to read controllers, I made a small program that will output the binary value for locations $18-$1B. Kurt previously mentioned that all ZP addresses $10-$1F get loaded with various values and that some games rather read $14 and thereabouts. It might be possible that different locations contain different combinations of bits, but this is what I found so far:

Code: Select all

|----------+----------+----------+----------+----------|
|  BINARY  |   $18    |   $19    |   $1A    |   $1B    |
|----------+----------+----------+----------+----------|
| 00000010 | LJ Down  |          | RJ Down  |          |
|----------+----------+----------+----------+----------|
| 00000011 |          |     U    |          |     F    |
|----------+----------+----------+----------+----------|
| 00000100 | LJ Right |          | RJ Right |          |
|----------+----------+----------+----------+----------|
| 00000101 |          |     Y    |          |     G    |
|----------+----------+----------+----------+----------|
| 00000110 |          |     7    |          |     B    |
|----------+----------+----------+----------+----------|
| 00001000 | LJ Up    |          | RJ Up    |          |
|----------+----------+----------+----------+----------|
| 00001001 |          |  Return  |          |  Delete  |
|----------+----------+----------+----------+----------|
| 00001010 |          |     : ?? |          |     Z    |
|----------+----------+----------+----------+----------|
| 00001100 |     1    |     L    |   Space  |     W    |
|----------+----------+----------+----------+----------|
| 00010001 |          |     P    |          |     A    |
|----------+----------+----------+----------+----------|
| 00010010 |          |     0    |          |     X    |
|----------+----------+----------+----------+----------|
| 00010100 |          |     K    |          |     E    |
|----------+----------+----------+----------+----------|
| 00011000 |          |     ; ?? |          |     Q    |
|----------+----------+----------+----------+----------|
| 00100000 | LJ Left  |          | RJ Left  |          |
|----------+----------+----------+----------+----------|
| 00100001 |          |     O    |          |     S    |
|----------+----------+----------+----------+----------|
| 00100010 |          |     9    |          |     C    |
|----------+----------+----------+----------+----------|
| 00100100 |          |     J    |          |     R    |
|----------+----------+----------+----------+----------|
| 00101000 |          |     , ?? |          |     4    |
|----------+----------+----------+----------+----------|
| 00110000 |          |     / ?? |          |     2    |
|----------+----------+----------+----------+----------|
| 01000001 |          |     I    |          |     D    |
|----------+----------+----------+----------+----------|
| 01000010 |          |     8    |          |     V    |
|----------+----------+----------+----------+----------|
| 01000100 |          |     H    |          |     T    |
|----------+----------+----------+----------+----------|
| 01001000 |          |     M    |          |     5    |
|----------+----------+----------+----------+----------|
| 01010000 |          |     N    |          |     6    |
|----------+----------+----------+----------+----------|
| 01100000 |          |     . ?? |          |     3    |
|----------+----------+----------+----------+----------|
| 10000000 | LJ Fire2 | LJ Fire1 | RJ Fire2 | RJ Fire1 |
|----------+----------+----------+----------+----------|
The notion for Fire1 and Fire2 might actually be swapped.
One side effect is that if you move the joystick diagonally up + right, you should generate an "1" or space.

Not yet identified: Shift, Control, Crsr <, Crsr >, ! " # $ % & ' ( ) @ * = + < > ?

I haven't looked up in FunnyMu if there are ways to enter Shift, Control and the cursor keys as the corresponding keys on the PC keyboard are used to simulate the joystick movements. I suppose this little program might be worth burning to an EPROM, inserted into the Diagnosticart and read all values from a real machine, unless they can be deduced from studying the BIOS disassembly of course.

Of course it is just a couple of minor changes to my program to dump all values $10 - $1F to screen and see how they relate to eachother.

Re: Memory maps, chip documentation

Posted: Sun Feb 10, 2013 12:17 am
by carlsson
Here is a simple program that will read all addresses $10 - $1F and display the contents on screen. The reading has a delay by 6 frames, so it doesn't register all the time. I haven't made any conclusions about how the values change depending on which key/joystick direction is pushed, but some addresses remain stuck with bits even after releasing it, and are cleared when some other key is pressed.

Re: Memory maps, chip documentation

Posted: Sun Feb 10, 2013 9:45 am
by MADrigal
Hi. I tested the program you attached and noticed that "bug" too. I'm guessing, isn't there in the BIOS, a "table" which you could use to control the joystick/jeyboard inputs? I suppose you used such a table for the Joy1 inputs.

Re: Memory maps, chip documentation

Posted: Sun Feb 10, 2013 11:30 am
by carlsson
No, I just read the zeropage values that Kurt mentioned before. I suppose I could read the values straight off the PIA as you mentioned, not sure what kind of values one then gets.

Re: Memory maps, chip documentation

Posted: Sun Feb 10, 2013 7:27 pm
by MADrigal
Just checked my BASIC listings. I used to peek locations 27 and 29 (decimal) in order to find which key was pressed.
I believe I got the info from the Wizzdom newsletters or the "Second Book of Programs" appendix.

Re: Memory maps, chip documentation

Posted: Sun Feb 10, 2013 7:32 pm
by MADrigal
OK I confirm on the "Second Book" appendix is all the infos you need.

The locations for joysticks are 17 and 19, plus there's many more for keypresses and buttons.

Get the book from this link:

http://www.madrigaldesign.it/creativemu/books.php?id=2

Page 85 and after ;)

Re: Memory maps, chip documentation

Posted: Sun Feb 10, 2013 11:05 pm
by carlsson
Decimal 17 = hexadecimal $11 so you'll get those readings in the above binary too. The positions I'm using in my game are $18-$1B (decimal 24-27), but it is possible that other positions give more unique results.

Edit: But yes, the book describes each location quite well and there are some clues to learn from it, e.g. how to easily detect that any key has been pressed, to determine if two or more keys were pressed, whenever the shift key was pressed etc.

Re: Memory maps, chip documentation

Posted: Mon Feb 11, 2013 10:38 pm
by carlsson
> However neither FunnyMu nor CvEmu2 will detect diagonal movement when reading these addresses?

I suppose no emulators will detect the diagonal movements because there's no such mapped key on the PC keyboard.

But from my memory, the games are fully playable both on FunnyMu and CvEmu2, by emulating the 2-arrow keys "combo".

This means that no Creativision games (from my memory) actually use the "real" diagonal positions: they use the "combo".

> Read keyboard
> $1C (dec. 28) will detect any keystroke. 0 = no key pressed, 2 = some key pressed,
> 3 = key released (POKE 28,0 to reset)

This might turn useful for the "Start game" routine. Typically a CV game begins when any key is pressed on any of the two keypads.

Re: Memory maps, chip documentation

Posted: Tue Feb 12, 2013 1:13 pm
by MADrigal
carlsson wrote:> However neither FunnyMu nor CvEmu2 will detect diagonal movement when reading these addresses?

I suppose no emulators will detect the diagonal movements because there's no such mapped key on the PC keyboard.

But from my memory, the games are fully playable both on FunnyMu and CvEmu2, by emulating the 2-arrow keys "combo".

This means that no Creativision games (from my memory) actually use the "real" diagonal positions: they use the "combo".

> Read keyboard
> $1C (dec. 28) will detect any keystroke. 0 = no key pressed, 2 = some key pressed,
> 3 = key released (POKE 28,0 to reset)

This might turn useful for the "Start game" routine. Typically a CV game begins when any key is pressed on any of the two keypads.
Me dumb! I "edited" your post, instead of "quoting it". :(

I'm really sorry!!!!!! Hopefully you have a copy of the original text. :oops: