Clanmaster21
6281e2036f
Optimised intoXX functions ( #19 )
* Optimised intoXX functions
Rewrote intoXX functions to mainly rely on intoHL, as the HL instructions are smaller and faster. Also removed some redundant push and pop instructions. I edited the given unit tests to test these, and they seem to work as expected.
* Doesn't use self-modifying code
The number of bytes is the same as my previous attempt, with 11 more cycles in intoHL, so although I don't feel as clever this time it's still a good optimisation. I found an equivalent method for intoDE, however relying on intoHL still allows for `ex (sp), hl` to be used in intoIX, which is smaller and faster.
* Update core.asm
* Tried harder to follow coding convention
Added tabs between mnemonics and operands, and replaced a new line I accidentally removed.
pirms 4 gadiem
luz.paz
6a635fddd9
Fix misc. source comment typos
Found via `codespell -q 3 -S ./tools -L splitted`
pirms 4 gadiem
Virgil Dupras
f4b6c7637d
zasm: rename #inc to .inc
scas, it's not needed any more.
pirms 4 gadiem
Virgil Dupras
22f9b4f07e
kbd: add keypad codes to keycode table
pirms 5 gadiem
Virgil Dupras
4f6c230dc8
mmap: add MMAP_LEN parameter
pirms 5 gadiem
Virgil Dupras
985d56ca5a
core: preserve A in cpHLDE
pirms 5 gadiem
Virgil Dupras
518f12b07f
sms/vdp: clear 2 lines forward when doing LF
It allows to see much more easily where the action happens on the screen.
pirms 5 gadiem
Virgil Dupras
f43241a5a0
kbd: support shifted characters
pirms 5 gadiem
Virgil Dupras
52e5f5b5bf
kbd: simplify code
pirms 5 gadiem
Virgil Dupras
77d805ea0f
shell: allow cmds to be shorter than 4 chars
pirms 5 gadiem
Virgil Dupras
01031a780a
ed: Add 'w' command
pirms 5 gadiem
Virgil Dupras
57e7b3ca05
recipes/sms/kbd: PS/2 keyboard adapter for the SMS!
pirms 5 gadiem
Virgil Dupras
23354eba94
stdio: fix broken ReadC logic
Looping inside ReadC broke the shell's hook logic. We have to
return immediately when nothing is typed.
pirms 5 gadiem
Virgil Dupras
253674ea05
Fix broken tests
Also, make tests run in a *BSD environment
pirms 5 gadiem
Virgil Dupras
eefadc3917
ed: add support for 'a' and 'i'
pirms 5 gadiem
Virgil Dupras
797cbdcc95
blockdev: protect IX in routines
Sure, it's a bit slower, but it prevents a lot of hard to debug
problems. I don't have to want to remember "don't use IX if you
have any blk* calls". Let's optimize I/O later.
pirms 5 gadiem
Virgil Dupras
8af1cf468c
ed: add 'd' cmd
pirms 5 gadiem
Virgil Dupras
3861670bcc
shell: don't parse empty cmds
pirms 5 gadiem
Virgil Dupras
951dd2206d
apps/ed: add the concept of "current line"
pirms 5 gadiem
Virgil Dupras
921a109749
stdio: little tweaks
pirms 5 gadiem
Virgil Dupras
e01ee170cb
stdio: add stdioReadC
A routine to conveniently read lines from TTY. Extracted from
shell. Will be used in other places.
pirms 5 gadiem
Virgil Dupras
ade9b96d14
sms/pad: make B jump to the next selection "class"
pirms 5 gadiem
Virgil Dupras
162e503291
sms/vdp: properly protect AF on PutC
pirms 5 gadiem
Virgil Dupras
f41508725d
sms/pad: handle return properly
That is, send current chr selection, and then, send LF.
pirms 5 gadiem
Virgil Dupras
9c87734499
sms/vdp: clear cursor before CR or BS
This avoids having "ghost" chr selection sticking around.
pirms 5 gadiem
Virgil Dupras
2679172edf
sms/vdp: implement "chrsel" hook
This allows for outputting a character selection before it's given
through GetC. That allows a pad-oriented character selection scheme.
pirms 5 gadiem
Virgil Dupras
74de1c92cf
sms/pad: implement character selection mechanism
Still a bit rough around the edges, but still, works rather well.
pirms 5 gadiem
Virgil Dupras
748d7347c8
shell: add "loop hook"
This hook is called during every iteration, allowing regular screen
refresh when video is involved.
pirms 5 gadiem
Virgil Dupras
404dbd0ddd
sms/vdp: handle CR and LF
pirms 5 gadiem
Virgil Dupras
2da4a3a87b
sms/vdp: new module allowing PutC to spit chars in the VDP
pirms 5 gadiem
Virgil Dupras
c5a0a6ff54
sms/pad: easily detect change in button config
pirms 5 gadiem
Virgil Dupras
9eb80d5eac
sms/pad: new module to manage Megadrive controller in SMS
pirms 5 gadiem
Virgil Dupras
b7cda6ed14
shell: improve reliability
Make ASCII_BS (sent when driven through kbd) make the same thing as
ASCII_DEL. Also, don't crash on filling the buffer.
pirms 5 gadiem
Virgil Dupras
ad31c7f7f5
kbd: make letters lowercase
We'll make them uppercase when we'll add support for shift.
pirms 5 gadiem
Virgil Dupras
cd7743b3ae
kbd: give the device a little breathing room in tight loops
pirms 5 gadiem
Virgil Dupras
e44ebb08b2
recipes/rc2014/ps2: drive a shell with ps/2 kbd!
pirms 5 gadiem
Virgil Dupras
9fb77054c0
Update docs w.r.t. its relationship with scas
pirms 5 gadiem
Virgil Dupras
69fc2e3bf2
sdc: make sdcReadBlk return error on max retries
It previously returned success!
pirms 5 gadiem
Virgil Dupras
66fbd20e21
sdc: tidy up
pirms 5 gadiem
Virgil Dupras
d9ae82c81e
sdc: enable CRC checks on blk write
pirms 5 gadiem
Virgil Dupras
2ac16d4750
sdc: check CRC during sdcReadBlk
When there's a mismatch, retry up to a certain number of times.
This makes random problem related to assembling big kernels go away! But
it also make SD card reading much slower...
pirms 5 gadiem
Virgil Dupras
cac9acca67
sdc: make some space in memory for buffer CRC
pirms 5 gadiem
Virgil Dupras
34db493496
sdc: implement CRC7 computation on cmds
For now, this achieves nothing else than wasting cycles, but this is the
first step in enabling CRC verifications (CMD59).
I think that this is where my random problems with assembling large
kernels from SDC come from: bad data that isn't detected. If that
happens when PGM loads programs in memory, then anything can happen.
`sdct`, when ran often enough, will error out or corrupt away (go
crazy)...
pirms 5 gadiem
Virgil Dupras
914c6d5abc
Update comments
pirms 5 gadiem
Virgil Dupras
00778f73e1
blockdev: fix bug recently introduced in load cmd
It would always load one byte less than told... This time it's right on
the money :)
pirms 5 gadiem
Virgil Dupras
8cf9904f33
blockdev: fix load command over-loading a byte
Calling `load` would always read one more byte than specified. Also,
make `0` mean `0x100`.
pirms 5 gadiem
Virgil Dupras
bd2877e012
shell: make arg in peek/poke mandatory
Also, make `0` mean `0x100`.
pirms 5 gadiem
Virgil Dupras
7c23e5a9ef
acia: protect DE during aciaInt
I don't know why I haven't noticed it wasn't protected. It must have
been behind many random problems I've been having...
pirms 5 gadiem
Virgil Dupras
3e7d181d3c
zasm: properly raise error on bas ioPutC calls
pirms 5 gadiem
Virgil Dupras
4327153ffd
zasm: fix include EOF detection
That was an interesting bug. It didn't cause a problem in emulation, but
in an RC2014 on an SD card, an include that didn't end with two newlines
would cause an infinite loop.
pirms 5 gadiem