Jump to content

svenvandevelde

Members
  • Posts

    378
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by svenvandevelde

  1. Vera Modes - Demo View File This demo program provides an overview of what the vera card can do in terms of the different configurations in text mode, tile mode, and bitmap modes. The demo is nothing really fancy, but the workhorse underneath is the new API library (veralib.c and veralib.h, conio-cx16.c etc. ) that allows to configure and control the vera card of the CX16 using the kickc compiler of Jesper Gravgaard: camelot / kickc · GitLab. The veralib library and source code of this demo program has become an integral part of the compiler and test programs, and can be downloaded also from src/test/kc/examples/cx16/cx16-vera.c · CX16_VERA · Sven Van de Velde / kickc · GitLab. If you're a C-programmer, and you're interested in using this library, please beware that this is still work in progress. However, if you're motivated to try it out, i'm really interested to get feedback on this c-library to understand if the API is useful and clear. Feel free to try out the program, by running it in an emulator in windows; the mobile phone emulators won't be able to run this program properly because the keyboard is needed to run this. More features are planned to be added. One of the features planned is to provide mouse support, so it can be run using the android emulators too. kind regards, Sven Submitter svenvandevelde Submitted 01/23/21 Category Graphics Apps  
  2. Inspire me ... Looking for the truth ...
  3. That's too bad (dissapointed). Maybe I should talk dutch to Mr. Van der Hoef ... (just kidding). Anyhow, it's a point that is rather important. It seriously limits the bitmap capabilties, but yeah, on the other hand, we will then only have 320*200 bitmaps in 256 colors :-(. But indeed, I must say it gives the machine an extra vintage flavour :-). Sv.
  4. Dear CX16 team ... Don't know how to say this but ... The team should consider to add 256K on the vera, in 4 memory banks! Don't make the mistake to add too less memory. The VERA should be able to show 640x480x8BPP bitmaps in 256 colors! I know it will make the machine more expensive, but come on! How much does RAM cost these days! Pls consider. Sven
  5. That is a wonderful idea! Great man. I'll try that. And let you all know the result here ... Sven
  6. @Jesper Gravgaard Hi Jesper, Congratulations with your compiler. This is a truly amazing work. Really! Your compiler does a trade-off between efficiency (and it does it very, very well), and functionality. It is also very transparent, the assembly code generated is readable, which makes it very useful for debugging or learning. Kudos! Sven
  7. What is the best method for loading 256 tiles in 8bpp (256 colors) of 16x16 dimension into the vera vram? This is 65536 bytes so this a full bank! Bank 0 contains the characters at f800, so should not be overwritten. Using bank 1 has weird side effects. I hear sounds when I fill the whole bank. Any advice? Sven
  8. What is the best method for loading 256 tiles in 8bpp (256 colors) of 16x16 dimension into the vera vram? This is 65536 bytes so this a full bank! Bank 0 contains the characters at f800, so should not be overwritten. Using bank 1 has weird side effects. I hear sounds when I fill the whole bank. Any advice? Sven
    Very nice! I enjoyed this. It is a flashback for me. Try to get the houses a bit better drawn, it will make your game better. Also also the physics need work ...
  9. OK. The mouse will require me to do some magic with the VIA # 2 etc. I will need to study this a bit ... Or ... indeed, I can use directly the ROM registers. There is no need anymore to disable the ROM as on the C64, because we have enough memory now! I saw the videos that prototype #2 of the CX16 hardware board has 2048KB RAM! That"s impressive and I think it is a good idea to continue with this amount of RAM available. But be careful you don't make the same mistake as with the Amiga. Ensure that the machine as enough RAM on the standard model. RAM doesn't cost and it is needed these days, even on 8-bit machines :-). (my 5 cents). I really enjoy seeiing the collaboration of your group and it is fantastic! This kind of machinery will allow me to "explain" to my kids how a PC works ...
  10. I will post in a minute a new demo It will even better demonstrate the capabilities of the CX16 ...
  11. Version 1.0.2b

    58 downloads

    This program is written using kickc of Jesper Gravgaard. I'm helping him to create a framework encapsulating the CX16 vera in order to be able to quickly create graphical effects for games. This is a short demo and I hope you like it. This program uses the keyboard to progress through the program! So be sure to run this from the desktop, since the emulator on mobile phones do not have a keyboard!
  12. VERA window panning demo View File This program is written using kickc of Jesper Gravgaard. I'm helping him to create a framework encapsulating the CX16 vera in order to be able to quickly create graphical effects for games. This is a short demo and I hope you like it. This program uses the keyboard to progress through the program! So be sure to run this from the desktop, since the emulator on mobile phones do not have a keyboard! Submitter svenvandevelde Submitted 01/12/21 Category Demos  
  13. I found out by looking into the cc65 assembly code of the cx16 section, that RAM bank 0 has a vector that contains the count of key presses waiting, which is stored in address $a00a. So, the following code works: // Return true if there's a key waiting, return false if not unsigned char kbhit(void) { char keys = 0; char* keysptr = &keys; kickasm(uses keysptr) {{ jsr _kbhit jmp continue1 .var via1 = $9f60 //VIA#1 .var d1pra = via1+1 _kbhit: ldy d1pra // The count of keys pressed is stored in RAM bank 0. stz d1pra // Set d1pra to zero to access RAM bank 0. lda $A00A // Get number of characters from this address in the ROM of the CX16 (ROM 38). sta keys sty d1pra // Set d1pra to previous value. rts // ... state matters) continue1: nop }} return keys; } Thanks to Greg King for his contribution! cc65/kbhit.s at master · cc65/cc65 (github.com) Sven
  14. Hi everyone, just I've updated my profile picture 🙂

  15. Hello everyone, I am in search for an easy method in assembly language to scan if a key is pressed on the X16 keyboard. I've been peering into the emulator source code and also I've been looking into the C64 best practices. I have found out that it's not so easy to get this method answered through self research and discovery/dedection. So, I've decided to ask here the forum ... Let's start with my main question! What is the main chip that is connected to the keyboard and detects the keyboard presses? I see in the ROM two methods implemented! The old C64 method and a new PS/2 keyboard method! Method 1: Is it the old C64 type of keyboard driver using the CIA chipset on ports $dc00 or ... Method 2: Is it through the new PS/2 keyboard through VIA chipset on the X16 using the via # 2 on ports $9f70, $9f71, $9f72 ... I've tried both methods, and non of them seem to work ... Let me explain each method that I tried to apply ... Note that the code is not optimal, it's trial and error code trying to figure our things ... Method 1 explanation: // Return true if there's a key waiting, return false if not unsigned char kbhit(void) { // CIA#1 Port A: keyboard matrix columns and joystick #2 char* const CIA1_PORT_A = 0xdc00; // CIA#1 Port B: keyboard matrix rows and joystick #1. char* const CIA1_PORT_B = 0xdc01; *CIA1_PORT_A = 0; return ~*CIA1_PORT_B; } Method 2 explanation: This code I've taken from the X16 emulator ROM kernal code, and I've reworked it to a kickc / kickasm source code. This code uses the VIA#2 chip of the X16 as documented, at the addresses, and this logic should fill ps2byte with the scan... Unfortunately, this does not seem to work and I really don't understand why not... char ps2byte = 0; while(!ps2byte) { kickasm(uses ps2byte) {{ jsr ps2_init jmp continue1 .var via2 =$9f70 //VIA 6522 #2 .var d2prb =via2+0 .var d2pra =via2+1 .var d2ddrb =via2+2 .var d2ddra =via2+3 .var port_ddr =d2ddrb .var port_data =d2prb .var bit_data=1 // 6522 IO port data bit mask (PA0/PB0) .var bit_clk =2 // 6522 IO port clock bit mask (PA1/PB1) // inhibit PS/2 communication on both ports ps2_init: ldx #1 // PA: keyboard jsr ps2dis dex // PB: mouse ps2dis: lda port_ddr,x ora #bit_clk+bit_data sta port_ddr,x // set CLK and DATA as output lda port_data,x and #$ff - bit_clk // CLK=0 ora #bit_data // DATA=1 sta port_data,x rts continue1: nop }} kickasm(uses ps2byte) {{ jsr ps2_receive_byte jmp continue2 //**************************************** // RECEIVE BYTE // out: A: byte (0 = none) // Z: byte available // 0: yes // 1: no // C: 0: parity OK // 1: parity error //**************************************** ps2_receive_byte: // set input, bus idle lda port_ddr,x // set CLK and DATA as input and #$ff-bit_clk-bit_data sta port_ddr,x // -> bus is idle, keyboard can start sending lda #bit_clk+bit_data //ldy #10 * mhz ldy #10 * 8 // : dey loop: dey beq lc08c bit port_data,x // bne :- // wait for CLK=0 and DATA=0 (start bit) bne loop // wait for CLK=0 and DATA=0 (start bit) lda #bit_clk lc044: bit port_data,x // wait for CLK=1 (not ready) beq lc044 ldy #9 // 9 bits including parity lc04a: bit port_data,x bne lc04a // wait for CLK=0 (ready) lda port_data,x and #bit_data cmp #bit_data ror ps2byte // save bit lda #bit_clk lc058: bit port_data,x beq lc058 // wait for CLK=1 (not ready) dey bne lc04a rol ps2byte // get parity bit into C lc061: bit port_data,x bne lc061 // wait for CLK=0 (ready) lc065: bit port_data,x beq lc065 // wait for CLK=1 (not ready) lc069: jsr ps2dis lda ps2byte php // save parity //lc07c: lsr a // calculate parity lc07c: lsr // calculate parity bcc lc080 iny lc080: cmp #0 bne lc07c tya plp // transmitted parity adc #1 // lsr a // C=0: parity OK lsr // C=0: parity OK lda ps2byte ldy #1 // Z=0 rts lc08c: jsr ps2dis clc lda #0 // Z=1 rts continue2: nop }} printf( "ps2byte = %x\n", ps2byte ); } Who can help here? Sven
×
×
  • Create New...

Important Information

Please review our Terms of Use