Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display a character on screen #8

Open
bonnefoi opened this issue Aug 25, 2019 · 4 comments
Open

Display a character on screen #8

bonnefoi opened this issue Aug 25, 2019 · 4 comments

Comments

@bonnefoi
Copy link

I've not found a way to display a simple character on screen.
Could add this functionality ?

@BigEd
Copy link
Collaborator

BigEd commented Dec 21, 2019

You can use the WDM opcode to output a character to the debug text box - not quite what you're asking for perhaps. Try for example

LDA #$01
STA $0200
LDA #65
WDM 0
LDA #66
WDM 0
LDA #$05
STA $0201

@pmanolak
Copy link

I tried that but got a syntax error:
Indexing labels.. Found 0 labels. Assembling code ... **Syntax error line 4: WDM 0**
this occurs only when run the app locally but into the https://skilldrick.github.io/easy6502

@BigEd
Copy link
Collaborator

BigEd commented Aug 11, 2020

Sounds like your local copy is out of date:
git pull
might fix that. If not, try
git status
and paste its output.

@ts-soft
Copy link

ts-soft commented Jul 15, 2021

Looking at the source code, the author simply draws a small rectangle with a color at an indexed position in the small black window. At this point there isn't an attempt to draw a specific character, only a block of pixels of the specified color.

See line #198 in the assembler.js file.

`function updatePixel(addr) {

  ctx.fillStyle = palette[memory.get(addr) & 0x0f];                        // masks off any value in the second byte of the value in the screen location then sets the palette index 0 to 15 remains

  var y = Math.floor((addr - 0x200) / 32);                                    // index of row for the block

  var x = (addr - 0x200) % 32;                                                     // index of column for the block

  ctx.fillRect(x * pixelSize, y * pixelSize, pixelSize, pixelSize);       // puts a rectangle of 32x32 pixels at the correct location, color was already set in the ctx.fillStyle() routine

}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants