[A83] Official H**s Replacement Commands & Questions & PulseWidthModulat


[Prev][Next][Index][Thread]

[A83] Official H**s Replacement Commands & Questions & PulseWidthModulation




HRC1: ex de,hl = push de \ push hl \ pop de \ pop hl ;this should work, I
guess
HRC2: ld a,xx = push bc \ ld b,xx \ ld a,b \ pop bc
More crap coming soon, maybe...
Feel free to add other commands...

Question:
1 What does ldir do? Does it copy the graph buffer to the screen? In
   ionm.z80 it's used to run a module stored in saferam1 (graph buffer?)
2 Is there a command that extracts bits from a variable? I think 'bit' does
   the trick, so bit 1 is the first bit of a and bit 2 is the 2nd bit of a
   and bit 3 the 3rd, ... and I think it sets the zero flag for 1 and the
   nonzero flag for 0. Is this correct?

PWM:

Didn't test it, but this should work. The 'on' pulse is a bit longer than
the 'off' pulse.

begin:
    ld b,0
loop:
    bcall(_getky)
    cp kDown
    call z, incb    ;speed down
    cp kUp
    call z, decb    ;speed up
    cp kClear
    ret z
    ld a,C3    ;off
    out(00),a
    call wait
    ld a,C0    ;on
    call wait
    jp loop
incb:
    inc b \ ret
decb:
    dec b \ ret
wait:
    ei \ halt \ djnz wait \ ret








Follow-Ups: