Commit Graph

255 Commits

Author SHA1 Message Date
Brad Grantham
0687587428 Make all screen elements widgets
Widget for Apple 2 screen (graphics and textport)
Make box be vertical or horizontal
Add spacer widget
Fix calls to draw, click, drag, release to reflect whole screen being a widget
Fix #16
2016-11-29 13:16:20 -08:00
Brad Grantham
cfe9d962d8 BCD mode; SED; AND zpg, X 2016-11-29 00:25:04 -08:00
Brad Grantham
91e8aaf726 Widgets draw in area, and implement centering widget, fixing #7 and fixing #6 2016-11-28 18:43:53 -08:00
Brad Grantham
577a806799 Key repeat, fixes #21 2016-11-28 17:17:57 -08:00
Brad Grantham
ca376dab5a CAPS lock, More instructions and compatibility
GLFW doesn't pass through Mac CAPS lock key for some reason.
CAPS button in GUI works, though.
Implement more instructions, mostly for ChopLifter
    DEC abs, X
    INC abs, X
    AND (ind), Y
    AND abs, X
    ROR abs
Now ChopLifter needs unimplemented SED!  Probably uses decimal mode while printing score.
Set "then" at end of CPU loop to try to throttle better.  Not sure it helps.
2016-11-28 14:22:22 -08:00
Brad Grantham
f107f4b23d More instructions and compatibility
Fix ADC abs (was accidentally adding Y to address)
Also handle bank switch registers on write
Initialize CPU6502 registers to 0 to match fake6502
    Avoid spurious differences
Implement more instructions
    ADC (ind), Y
    ADC abs, X
    ORA zpg, X
2016-11-28 13:27:52 -08:00
Brad Grantham
43bb5d2663 cycle table formatting and more data 2016-11-28 09:55:01 -08:00
Brad Grantham
0b1b083f6c don't enqueue new audio buffer if no audio 2016-11-28 09:54:36 -08:00
Brad Grantham
604bf07b4f Partially implement floppy disks
Floppy disks partially work:
    apple2e -noaudio -fast -diskII disk2romfile {floppy1name,"none"} {floppy2name,"none"} apple2e.rom

Import nybblizer from Shamus but only DOS
Support floppy hardware
    track motor stepper
    enable
    read
Add -noaudio (otherwise execution is throttled by waits once audio buffer is filled)
Only read ROM at D000 and E000 if C08X_read_RAM isn't turned on
RAMRD, RAMWRT, and ALTZP are implemented, note them as such in constructor
Correctly decode C08X soft switches
Implement a bunch more instructions
    INC abs
    LDY abs, X
    SBC abs, Y
    ADC abs
    ASL abs
    LSR abs, X
    ORA abs
    ORA abs, X
    AND abs, Y
    STA (ind, X)
    LDX abs
    CPX abs
    EOR (ind, X)
    EOR abs
    EOR abs, X
    STX abs
Throttle to actual number of clocks per instruction
Temporarily enable "Fake6502" instead of my CPU because there's an obvious difference
Better blink speed in interface.cpp
2016-11-27 17:10:03 -08:00
Brad Grantham
fb476db138 beginning of diskII support 2016-11-26 14:51:14 -08:00
Brad Grantham
a9f5b9f18a Audio. Probably won't work properly in FAST mode.
Try COLORBOUNCESOUND.A.
2016-11-23 23:29:23 -08:00
Brad Grantham
97e5923939 fix paste to only work with SUPER key (CMD on Mac), fix #4 2016-11-23 22:20:04 -08:00
Brad Grantham
e9453b7fe7 use RED_INTEGER instead of RED_INTEGER_EXT, lose glext.h 2016-11-23 21:15:39 -08:00
Brad Grantham
4085189d9f Make instruction timing a lot more correct
Fix up clock timing on absolute-indexed, indirect-indexed, and branch instructions
Emitted clock ticks now match up with emulated and video recorded beep sound
(code to save off and postprocess ticks not checked in)
2016-11-23 20:31:30 -08:00
Brad Grantham
873aeb596f remove unneeded libraries and includes 2016-11-23 16:36:43 -08:00
Brad Grantham
e29d6ff984 implement ORA (ind), Y for Integer Basic 2016-11-23 16:36:29 -08:00
Brad Grantham
6876176b6b note code can be pasted from clipboard 2016-11-23 16:34:30 -08:00
Brad Grantham
f84a6576cc say better that the C++ code should be cross-platform 2016-11-23 16:32:23 -08:00
Brad Grantham
6750eb1463 remove TTF font, not needed for console any longer 2016-11-23 16:30:52 -08:00
Brad Grantham
5040f3d739 Document dependencies to resolve #1 2016-11-23 16:29:36 -08:00
Brad Grantham
d74c0abeb4 script to emit cycles-per-instruction 2016-11-23 15:44:29 -08:00
Brad Grantham
df043ec9a0 fixup font lookup, solving off-by-one-pixel issue 2016-11-23 15:43:57 -08:00
Brad Grantham
c0a1aafbb8 system clock; count instruction cycles except branch/page penalties 2016-11-23 15:29:47 -08:00
Brad Grantham
4db793add1 PAUSE button works, CAPS and COLOR unimplemented 2016-11-23 10:53:56 -08:00
Brad Grantham
ff9f29ef9d name size getter more correctly; add some notes 2016-11-23 10:34:15 -08:00
Brad Grantham
f8d14e6b32 Add buttons for REBOOT, FAST
Forgot "SPEED" enumerant in interface.h
2016-11-22 23:11:22 -08:00
Brad Grantham
617d59d1d4 add flags to README 2016-11-22 20:05:42 -08:00
Brad Grantham
f204764575 Add buttons for REBOOT, FAST
Factor out "text_widget" that can draw text
Change "button" widget to "momentary"
Add new "toggle" widget
Use vbox to contain all buttons
2016-11-22 20:02:49 -08:00
Brad Grantham
7f8539ae00 Add RESET button
Add button class to interface
Check for press/drag/release of RESET button
Add FG and BG color for textport shader (for active button)
Handle RESET and REBOOT events in main loop
2016-11-22 16:09:48 -08:00
Brad Grantham
c59535af28 fixup cut-and-paste 2016-11-22 09:53:35 -08:00
Brad Grantham
8103d2a10f Correctly issue "lores" shader uniforms 2016-11-22 09:49:58 -08:00
Brad Grantham
faea049a6b Screen projection matrix to shaders for regularity
Multiply by a matrix in vertex shaders to convert from pixel
coordinates to window coordinates, moving that operation out to a
centralized place in the application.
2016-11-21 18:56:31 -08:00
Brad Grantham
c9cf0a753a remove debugging border 2016-11-20 14:25:18 -08:00
Brad Grantham
5a3c9deb21 Fix viewport. Some factoring.
Factor out shader binding for code simplification.
Factor out making vertex array in anticipation of UI buttons.
Change "mode" to "display_mode".
Fix setting of glViewport on window resize
2016-11-20 14:21:49 -08:00
Brad Grantham
ae04f41257 make UI more interactive in fast mode 2016-11-20 14:21:01 -08:00
Brad Grantham
d212e8f112 Allow running without TTY (e.g. in Instruments)
Continue running if TTY cannot be opened
2016-11-20 12:27:58 -08:00
Brad Grantham
9554f80a00 Allow option to free-run 6502 clock
-fast command-line option and "fast" debugger command enable 6502 to essentially run as fast as possible.
In "fast mode", execute approximately 10 seconds worth of instructions
  before UI update.
    Since UI update is probably locked to 60Hz max, upper limit will be 600x normal speed
    But my guess is (on my Macbook Pro 13 Retina 2013) it's running about 70x,
      so there's enough overhead to limit execution to ~70MHz.
2016-11-20 12:23:42 -08:00
Brad Grantham
eec4926c50 properly output and use checkerboard char 2016-11-19 00:57:42 -08:00
Brad Grantham
32854e2246 implement paste through interface 2016-11-19 00:45:39 -08:00
Brad Grantham
7192c35a42 blink text 2016-11-18 23:55:28 -08:00
Brad Grantham
dc48acbb32 generate HGR row interleaving 2016-11-18 23:29:57 -08:00
Brad Grantham
53455ad9f3 Ray-tracer 2016-11-18 23:26:22 -08:00
Brad Grantham
68c99726ca Draw lines mirrored in X and Y 2016-11-18 23:26:01 -08:00
Brad Grantham
e5d65591af Show all LORES colors 2016-11-18 23:25:48 -08:00
Brad Grantham
01d8b4e1b2 HIRES fractal 2016-11-18 23:25:22 -08:00
Brad Grantham
7821df7faf LORES bouncing pixel 2016-11-18 23:25:03 -08:00
Brad Grantham
21e800658c LORES ("GR") mode and inverse text
Add lores shader and implement in redraw
Handle inverse text, but it indicates glyph lookup or raster location is off by one, not sure what's going on there.
2016-11-18 23:17:07 -08:00
Brad Grantham
cabfe5191e Mostly rewrite graphics to use shaders
Move to GL 3.2
Draw a quad with shaders depending on the mode in that part of the screen
    HIRES shader reads from hires texture
    TEXTPORT shader reads from textpor texture and indirects through a font
      to get pixel values
MIXED now supported
Still to do: BLINK text, INVERSE text, LORES, gang up HGR memory updates
Why doesn't cursor flash the checkerboard?
2016-11-18 20:54:19 -08:00
Brad Grantham
00c4ea0a41 update to large-vertical-array format 2016-11-18 20:53:40 -08:00
Brad Grantham
d7d2d912b0 utility to extract C from font image 2016-11-18 11:33:50 -08:00