Jump to content

damosan

Members
  • Content Count

    108
  • Joined

  • Last visited

Community Reputation

52 Excellent

1 Follower

About damosan

  • Rank
    Chopper Commander

Recent Profile Visitors

1,890 profile views
  1. This is really cool but how useful is it? Once you have a JVM running on a 48/64k machine how much is left over for byte code? I built a toy VM a few years ago implementing a 16 instruction stack machine. It worked well and I started to implement some of the core in assembly but then the tech ADHD SQUIRREL! happened...
  2. But cc65 doesn't do that thankfully. Unless you want it to... I'm pretty sure the linker pulls in what it needs - looking at the map file shows this. If you want printf() style output you can always build your own using variable arguments. My lw_printf() routine handles strings, bytes, and words and weighs in at around 640 bytes.
  3. I applied a few changes to a previous version in C and then passed it through cc65 (with -Osir) to see the resulting code. It doesn't look too bad. Instead of using X = X + 1 I used ++X (and --X) which allows cc65 to use inc/dec vs. the lda/clc/adc. lda _flicker beq L0002 lda #$04 sec sbc _FLIP sta _FLIP lda _CHAddr clc adc _FLIP jmp L000F L0002: lda _CHAddr clc adc #$08 L000F: sta $02F4 inc _TOGL lda _TOGL cmp #$04 bne L000D lda #$00 sta _TOGL lda _ExAnim0 beq L0011 sta $02C0 dec _ExAnim0 jmp L0012 L0011: sta $D000 L0012: lda _ExAnim1 beq L0014 sta $02C1 dec _ExAnim1 jmp L0015 L0014: sta $D001 L0015: lda _ExAnim2 beq L0017 sta $02C2 dec _ExAnim2 jmp L0018 L0017: sta $D002 L0018: lda _ExAnim3 beq L001A sta $02C3 dec _ExAnim3 rts L001A: sta $D003 L000D: rts
  4. How long did folks use the Alcyon compiler in anger? I suspect folks dumped it the minute better compilers became available - I remember using Haba Hippo-C and Megamax C in 86/87.
  5. If you're only going to do a few bytes at a time... ldx #0 lda $6000,x sta $7000,x inx <repeat n times> ...or do you have to use Y for this? Doesn't matter as the point is you can inline byte copies for a small number of bytes easily. The code will run quite a bit faster as there are no compares, no jumps, etc. You can probably use ZP as well to reduce the byte counts and increase speed further. This is where ca65 comes in handy - you can create a core repeat macro and then create all sorts of byte copies for arbitrary sizes at assembly time. Or make it smarter so that it will try to use inline code but if it cannot then it hops over to memcpy().
  6. I see multiplication in the main game loop - get rid of that if possible. As you know 6502 likes addition and subtraction. If you need to multiply or divide try to do it with shifts. Better yet to compute at compile time and use an array. Function calls with a lot of parameters are horribly expensive with cc65 (and 6502 in general) - inline what you can (or use zero page memory). You can enable static locals at compile time also. That may help. I notice you memcpy for 8 bytes here or 9 bytes there. It may be faster just to POKE() those values into memory directly - especially if they're static values. There's a certain point where memcpy makes sense - I'm not sure where that point is though. Have you tried to look at the generated assembly language? I think you may be horrified by what you find. Your game loop may be taking too long so the VBI routine is updating the screen based on half-updated game state? Properly tuned C can be pretty quick but you need to follow certain conventions - the end result may make a C programmer frown but it's what you have to do. I've seen properly tuned C code easily keep pace with Action!.
  7. The floppy in my MSTe died so I ordered a replacement from Best. This morning I cracked the case open and I noticed the two wires running to the power LED (the light on the front left of the case) were just laying on the mother board. I checked online but didn't find anything. Can anyone take pics of how theirs are connected? I'd like to reconnect these lines (and the HD activity thing as well...but that's easy). Thanks.
  8. The floppy in my MSTe died so I ordered a replacement from Best. This morning I cracked the case open and I noticed the two wires running to the power LED (the light on the front left of the case) were just laying on the mother board. I checked online but didn't find anything. Can anyone take pics of how theirs are connected? I'd like to reconnect these lines (and the HD activity thing as well...but that's easy). Thanks.
  9. I'd like one of these. Muh PBI ports are bare...and that's sinful.
  10. Left margin is like 47 and the right is 206ish? I need to map that to 0 - 319.
×
×
  • Create New...