Jump to content


Super Administrators
  • Posts

  • Joined

  • Last visited

  • Days Won


TomXP411 last won the day on June 22

TomXP411 had the most liked content!


Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

TomXP411's Achievements

  1. This snippet will let you query VERA to get the address of the text screen. M1 will contain the bank number and M2 is the first character of the screen: 10 M1=(PEEK($9F35)AND 128)/128 : M2=(PEEK($9F35)AND 127)*512 30 PRINT "BANK:";M1 40 PRINT"ADDR: $";HEX$(M2) This program reads L1_MAPBASE at $9F35 and splits the value apart to get the bank and the top 7 bits of the address. We have to do some math to get there, because L1_MAPBASE actually contains the top 8 bits of a 17 bit address. So the first thing to do is split off the top bit. This bit's value is 128 or $80. So we use AND 128 to get just that one bit, then divide it by 128 to get the bank number. Next, we need the bottom 7 bits. The value of those combined bits is 127, so we can use an AND mask to read those. And since the VERA tile map always starts on a 512 byte boundary, we can just multiply that by 512 to get the correct starting address. This should return Bank 1 ADDR $B000 on the emulator version 41. On R38 or older, this should return BANK 0 ADDR $0. To use this address, you can use VPOKE with M1 for the bank and M2 for the address: VPOKE M1, M2, 66 : VPOKE M1, M2+1, 1 Should put a ♣ symbol in the top left corner of the screen and set the color for that cell to white on black.
  2. The change happened in R39, I believe We've talked about it a lot here on the forum, and it's in the release notes. In versions prior to R39, display memory starts at 0 on VERA. So to write a character to the top left corner of the screen, you would VPOKE 0,0,C Starting in R39, the memory location has changed to $1B000. Note that this is a 5 digit address, and so you need to use bank 1 in VERA, like this: VPOKE 1, $B000, C Since this can change in the future, the smart thing to do is to read from VERA to confirm the starting address of the display. This is called L1_MAPBASE in the documentation and is at $9F35 Here's a sample program that will read the Map (screen) address and give you the bank and address to use in your program. If you change B and T to variables that 10 M1=(PEEK($9F35)AND 128)/128 : M2=(PEEK($9F35)AND 127)*512 30 PRINT "BANK:";M1 40 PRINT"ADDR: $";HEX$(M2) So if you use line 10 at the top of your program, you will always know the start of the screen on any recent firmware release, and you can modify the screen like this: VPOKE M1, M2, C
  3. Based on the comments made by people familiar with the code, it's unlikely to work on a Pi at 8MHz. I have also compiled it on the Raspberry Pi, and it does run, but it gives me about 4MHz effective. This is consistent with the kind of performance we see on other emulators running on the Pi. VICE can handle about 400% speed, and in fact, even VICE can't run at 1MHz with the high accuracy emulator and high quality audio enabled.
  4. Welcome. I prefer 64TASS myself, partly because of the quality of its documentation, but also because it's portable and easy to use. I'm glad there are so many choices for 6502 assemblers; there's something to match everyone's needs.
  5. Last I heard, the official story is that the sockets would be there, but that only one out of the four would be populated. So unless the plans have changed, the chip select and other hardware will be on the board. We're literally just talking about 3 memory chips.
  6. Happens to the best of us. Every time I post a tutorial or even just a code sample, I end up having to go back and fix something. And you were right about using the ; instead of + to concatenate the characters. Using + will build a string and then pass it all at once, whereas using ; will transmit the individual characters one at a time without building a new string on the string table. so my example for 1024 should be: PRINT#15, "P";CHR$(8);CHR$(0);CHR$(4);CHR$(0);CHR$(0)
  7. No. FYI, for some reason, this manual doesn't get included with the emulator build. You can read the DOS manual here: https://github.com/commanderx16/x16-rom/tree/master/dos
  8. Yeah, it can seem complicated, but when you boil it down, they're all doing the same thing. When I sat down to play around with a theoretical instruction set, I started by boiling down what you need: Read from memory Write to memory Copy data between internal registers Arithmetic: Add, Subtract, AND, OR Compare Branch That's really it. Every CPU performs those operations in some combination, and jumping from something like 6502 to Z80 is mostly a matter of learning the different ways we write those same commands. 65x: LDA $1234 8080/8085/Z80: it's LD A,(1234h) x86: MOV AX,[1234h] Once you get that part figured out, you stop thinking in terms of the specific chip and start thinking in terms of the operation. At that point, you just have to remember which words go with which operation, and you can get that with a good opcode chart and some experience.
  9. Yes, the Zilog mnemonics actually use parentheses, like the 6502, so when you see something like ld (hl),a, that is an instruction that uses HL as a pointer. For example, this saves a byte to the address pointed to by HL and then increments the HL pointer: LD (HL),B When copying to or from any of the other registers, only the HL pair can be used this way. However, the Accumulator can be used with any other register pair as a pointer: LD (BC),A LD (DE),A LD (HL),A and even LD (xx),A which is similar to STA (xx) on the 6502. There are also several bulk memory copy instructions that use (HL) and (DE) to move data around. Check out the LDI instruction, for example. When used with LDIR, you can copy a block of memory with just 4 instructions.
  10. That's incorrect: you are writing the number in Big-Endian format, and this will try to seek to location 262,144. The P command takes the low-order byte first. (That's what Little-Endian means). So if you were seeking position 1, you would send the bytes in this order: 01 00 00 00 If you were seeking position 256, you would send: 00 01 00 00 And 1024 is: 00 04 00 00 Likewise, if you were jumping 64K into the file: 00 00 01 00 And if you wanted to jump 16 megabytes into the file: 00 00 00 01
  11. Was this a request for help? I think I see your problem. Writing to SEQ files doesn't work with the host file system. You need an SD card image. You can create one yourself, or you can use the IMG file included with the emulator download. To start the emulator with the SD image, use the following command line: x16emu.exe -sdcard sdcard.img You'll also want to give yourself a couple of other helpful options, such as -echo mode (allowing you to copy plain-text BASIC programs) and the clock, so try this command line: x16emu.exe -echo -sdcard sdcard.img -rtc
  12. o.O Pointers are the key to C's most powerful features. If you don't use pointers in C, you lost most of the language's capability.
  13. This is also a good lesson in dealing with the quirks of C programming. This custom code was only necessary because of C's use of null-terminated strings and the fact that the Position command uses zeros as part of its data. ZeroByte is getting around this problem by forcing the data length to 6 (lda #6) and then pointing to a binary version of his Position parameters. Once this has been thoroughly tested and has something in there to trap any errors, this definitely needs to end up as part of the CX16 library for both cc65 and KickC.
  14. Actually, this is a tokenized BASIC file. So either PRG or a blank extension is just fine. When working directly on the Commander, I actually prefer binary programs to have no extension, since the PRG is implied, but you want PRG when using it with PC based software, since that's what most of us expect to see when working with Commodore binaries. The only time you should on use a .BAS extension is when the file is in ASCII format and not tokenized. (ie: you can view it on a PC with Notepad.) Personally, I prefer BASIC programs in text format, since I can look at them before loading them into the emulator.
  • Create New...

Important Information

Please review our Terms of Use