Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by rje

  1. Edge cases are not useless: they're interesting.
  2. THAT is very helpful! Thank you!
  3. This page is kind-of a placeholder for my questions and discoveries as I learn CMDR-DOS. Read the (current) Directory DOS"$" Make and Remove a Subdirectory DOS"MD:dirname" DOS"RD:dirname" Change Directory DOS"CD:dirname" DOS"CD:.." (to go up one level) Scratch (delete) Files DOS"S:filename" DOS"S:file1,file2,file3,..." DOS"S//dirname/:filename" Copy and Concatenate Files DOS"C:newfile=oldfile" DOS"C:newfile=oldfile1,oldfile2,oldfile3,..." Rename a File DOS"R:newname=oldname" Lock Files DOS"L:file1,file2,file3..." Creating a file in a subdirectory 10 DOS"MD:MY-DIR-001" 20 OPEN1,8,2,"//MY-DIR-001/:MY-FILE-1234,P,W" 30 PRINT#1,"HELLO, WORLD!" 40 CLOSE 1 50 OPEN 1,8,2,"//MY-DIR-001/:MY-FILE-1234" 60 INPUT#1,A$ 70 CLOSE 1
  4. Okay, I was misleading. The KERNAL routines developed a bit up until the VIC-20, but there still is compatibility, and the intent was to provide a separation -- an API -- between the system and MS BASIC. By the time of the VIC-20, the KERNAL was documented and forward-compatible. Your (fun!) reading assignment: https://www.pagetable.com/?p=926 And the (even funner!) KERNAL API reference: https://www.pagetable.com/?p=1401
  5. I admit the things people did/do with the C64 is Scary Magic, and I'm not worthy. Yes, the KERNAL is the jump table common to all 8-bit Commodore computers for handling I/O (mostly?). It's a Good Thing. The X16 doesn't have a SWEET 16, although Bruce has created a variant of it "for fun" somewhere around here. However, the X16 does have new routines for handling 16 bit values, stored in pseudo-registers in zero page. It's not a VM, but simply a set of convenience routines. Michael is to blame for them, at least partly, and I think they're a Good Thing too.
  6. 8 bytes no longer matters, I think it's safe to say, although I more often feel the pull towards smaller trumps faster... even though context is king. Was it Knuth who said you should have both (a) a fast routine and (b) an efficient routine handy? (I don't think it was Knuth. It was someone like that tho.) Will acquire a copy of Butterfield's book. Thank you.
  7. Thanks for posting the tables, Mr. Geek 504. It is a Big Gulp for sure, but it's always nice to discuss options, be it ROM or a card or whatever. Wolf3D on the X16.... whoo.... Did you say you were new to the Commodore Line of Stuff? You do know about the KERNAL though, right? And the X16's pseudo-16-bit routines? And Bruce's variant of SWEET16?
  8. This is exactly my sentiment. I can solder a header onto a Raspberry Pi Zero. But I lack the experience and equipment for the inevitable troubleshooting -- I mean if those guys on YouTube make mistakes on computer kits, my odds are very poor. Don't Fear The Soldering Iron has been my mantra for decades. So while I cannot buy the kit, I am yet drawn to it. It's a KIT!!! But I'm going to buy the pre-built version because, as Clint Eastwood taught us, a man's got to know his limitations.
  9. SWEEEEEEEEET!!!!!!!!! TRAVELLER SHALL LIVE! (P.S. Thanks for the code snippet!)
  10. Welcome Sebastian! I've found the X16 does focus my mind when it comes to design and implementation; however, it is actually stretching my mind when it comes to graphics.
  11. Namaskaram! As mentioned above, the C cross-compiler is also an option (cc65 can also assemble 6502 assembly). Even though I'm comfortable in C, I've found that I'm prototyping on the X16 in BASIC, then "uplifting" some of that code into 6502 assembly. For the X16, I write bits of interpreters using C, but haven't produced anything interesting yet. It seems that whenever I think about doing that, I end up writing BASIC + assembly language instead. This is one reason I await a "structured BASIC" for the X16.
  12. I'll add these and see what happens! stop: ;******************************************************************************* ldx #0 stx running rts restart: ;******************************************************************************* ldx #$ff stx phase rts
  13. When I read about polling the controllers, I thought that it was sinful moving away from memory-mapped I/O. But then I remember (once again) a video by 8-bit Show and Tell where the "1nvader" programmer had to do what almost amounts to "de-bouncing" the joystick fire button to avoid false triggerings. And, I was glancing over Woz' tiny monitor, and I see that in order to print stuff to the Apple's screen, he has to explicitly check the state of the display driver. Whereas we simply have to jsr $ffd2. So, bring on the routines. This is fine.
  14. So I wrote this quick-and-dirty BASIC program just to play with the values, and it works ... as long as I don't try to change the envelope while the sound routine is actually running. In other words, you have to wait for the decay to complete before changing a value! TEST-SOUND.BAS
  15. Last month I was writing a little routine to print numbers in hex, and I got stuck. Today I picked it up and realized that I was very close to a solution, but surely someone has already solved this problem. And indeed, Steve Wozniak gave me valuable pointers in his wozmon.txt file... in particular: PUSH the value onto the stack to save the cycles of having to LDA later. Use ORA instead of ADC for the initial add, and use a BCC when testing for a digit. That second point proved to be the key to solving my code problem. At any rate, here's my working code: ; ; Prints an 8 bit value in hex. ; ; Author: Robert Eaglestone with valuable advice from Steve Wozniak ; More Info: wozmon.txt ; ; System: Commander X16 ; Version: Emulator R.37 ; Compiler: CC65 ; Build using: cl65 -t cx16 hex.s -C cx16-asm.cfg -o HEX.PRG ; chrout = $ffd2 ; Commodore Kernal RULES! .org $8000 .export LOADADDR = * ; $8000 value: .byte 0 ; 0-255 ; $8001 Main: lda value pha ; save A for LSD print_hi: ; ; print the high nybble ; lsr ; shift right four bits lsr lsr lsr jsr hex print_lo: ; ; print the low nybble ; pla ; fetch for LSD hex: and #$0f ora #$30 ; i.e. "0" cmp #$3a ; digit? bcc echo ; yes adc #6 ; add offset for A echo: jsr chrout ; print it rts
  16. I'm going to plug this into my Rogue Forest program, because it's got exactly what I want: simple sound effects.
  17. I watched a video by 8 Bit Show and Tell (Robin's show) where he fixes the old PET Dungeon! game to run with BASIC 4.0. I learned that a difference between 2.0 and 4.0 is that strings are later augmented by a pointer back to their owner, so 4.0 strings are two bytes longer than 2.0 strings. This space cost vastly improves garbage collection speeds, something hinted at by a Butterfield article 35+ years ago. Makes me think the X16 "ought" to have the BASIC 4.0 strings and garbage collection. ANYWAY, he reset high RAM to coincide with screen RAM. The result? When he allocated a string, it magically shows up at the "end" of the screen! He used that visualization trick to show how memory is allocated off the heap in Commodore 2.0 versus 4.0, and it was COOL. I'd love to have a Heap Visualizer for the X16. One incarnation would be a small interrupt-driven program to copy the top chunk of high BASIC RAM to VERA, for example to SPRITE data or screen memory or something. Not sure. It would probably have to be non-intrusive and therefore not directly written to screen memory. Whatever. But it wouldn't have to run every jiffy or however fast interrupts run. This one would need to update every second or three or ten. It's almost like that solution would need a CRON-X16 to manage interrupt jobs... But I digress.
  18. That's bueno -- I was wanting that FLASH/NO FLASH code. I was specifically grumbling about VERA, and that a VPOKE x,y,z shifts $40-$5f down to $00-$1f, etc. I hadn't thought about it, but Tom already knew:
  19. I didn't realize that keyboards had to have dual control firmware to handle PS/2 + USB. Learn something new every day. I've got one of the X16 WASD keyboards, and I love it, by the way. I use it every day for work, and non-work, and X16 hacking. Just icing on the cake that it works in both modes. With Cherry switches I guess it will last for the rest of my life. I found it a little worrisome, because I *already know* how to read the C64's joystick ports -- heck, I remember that they're at $DC00 and $DC01, and I haven't programmed for them in 34 years. But, I understand the argument for MOAR BUTTONS, and I think that opens up interesting stuff you can do, so, OK. I'm also glad that there are pin headers for an additional two controllers, but that's just me remembering M.U.L.E. Hmm, there's another game I want to write for the X16. I should have a list.
  20. My wife and I both grokked Diablo II, so I think you're right. I'll have to think about a reasonable way for allowing that for players (unsure)... or else preventing monsters from attacking diagonally (easy). The mouse might indeed be the right solution, in addition to allowing easy ranged targeting as you mentioned... Ranged attacks are also interesting, because it makes me think of the combat system in early Ultima games (e.g. Ultima III). And THAT makes me wonder if it would be good if the map were expanded, or developed, or ... Tom, it was your suggestion *and sample code* for using the other layer that made it all work. Thank you! ...I'm also thinking about PSG sound effects...
  21. To paraphrase enthusiasts via Wikipedia, in order to be "officially" rogue-like, a game ought to be: 1 * a random dungeon 2 * turn-based 3 * hack-and-slash 4 * GOAL-oriented: e.g. retrieve the Amulet of Yendor, and escape/perish with as many game points as possible 5 * "permadeath" 6 * support emergent gameplay via complex rule interactions 7 * have resource management as the key to survival (food, water, potions) 8 * have obscure objects - newly discovered objects only offer a vague physical description that is randomized between games - described by color, and only later reveal its True Name via use/experimentation - purposes and capabilities are unstated - the identity of magical/enchanted items varies from run to run. - "Bubbly potion" might heal in one game and poison in another. I've got items #1, #2, and #3 implemented.
  22. Rogue Forest View File This is a work in progress, which means there's lots of missing functionality, the UI is rough, there are unfinished bits, and there's no "win" or "lose" condition, yet. The map is revealed as you explore. There are two kinds of treasures -- weapons and armor -- and one special treasure: the Amulet of Yendor. The goal of the game *will* be to find the Amulet of Yendor and exit the forest with it. There are 31 monsters in the forest. They (currently) are not differentiated, except by name. Movement is via the cursor keys. Trees are impassable. "Bump" a monster to attack it. There are no special commands, yet. I will add some sound effects before promoting it to 1.0 Submitter rje Submitted 08/24/20 Category Games  
  • Create New...

Important Information

Please review our Terms of Use